Open
Conversation
Updated XML documentation for the Channel property to include a reference to Channels.
bfb5d97 to
aa481cb
Compare
Update PreloadedPcmSource.cs Update Speaker.cs Create WavUtility.cs Update WavStreamSource.cs Update PreloadedPcmSource.cs Change default stream parameter to false in PlayWav Update PlayWav method to default stream to true Change TargetPlayers from List to HashSet
aa481cb to
052e46d
Compare
Update PreloadedPcmSource.cs Added another constructor for public usages Update PreloadedPcmSource.cs
01439ee to
51298ee
Compare
- Introduced a full Event system to the Speaker class (Started, Finished, Stopped, Paused, Resumed). - Implemented `Seek()` functionality and added `CurrentTime` / `TotalDuration` properties. - Utilized `double` precision for all time related calculations to ensure accuracy. - Updated `WavStreamSource` and `PreloadedPcmSource` to support the new seeking logic.
0c2ba50 to
3f7ce95
Compare
4983722 to
ae9992f
Compare
-Optimized WAV header skipping (string comparisons to direct uint32 hex checks)
0f9357c to
ae2103f
Compare
…into SpeakerToyReborn
…into SpeakerToyReborn
Someone-193
reviewed
Feb 2, 2026
Someone-193
reviewed
Feb 2, 2026
Comment on lines
+536
to
+571
| case SpeakerPlayMode.Global: | ||
| NetworkServer.SendToReady(msg, Channel); | ||
| break; | ||
|
|
||
| case SpeakerPlayMode.Player: | ||
| TargetPlayer?.Connection.Send(msg, Channel); | ||
| break; | ||
|
|
||
| case SpeakerPlayMode.PlayerList: | ||
| using (NetworkWriterPooled writer = NetworkWriterPool.Get()) | ||
| { | ||
| NetworkMessages.Pack(msg, writer); | ||
| ArraySegment<byte> segment = writer.ToArraySegment(); | ||
|
|
||
| foreach (Player ply in TargetPlayers) | ||
| { | ||
| ply?.Connection.Send(segment, Channel); | ||
| } | ||
| } | ||
|
|
||
| break; | ||
|
|
||
| case SpeakerPlayMode.Predicate: | ||
| using (NetworkWriterPooled writer = NetworkWriterPool.Get()) | ||
| { | ||
| NetworkMessages.Pack(msg, writer); | ||
| ArraySegment<byte> segment = writer.ToArraySegment(); | ||
|
|
||
| foreach (Player ply in Player.List) | ||
| { | ||
| if (Predicate(ply)) | ||
| ply.Connection.Send(segment, Channel); | ||
| } | ||
| } | ||
|
|
||
| break; |
Collaborator
There was a problem hiding this comment.
you could also make this flags based 😎
Author
There was a problem hiding this comment.
I'd prefer not to get involved for now; I mean, we can already do things that require flags with predicate or target lists, right?
Someone-193
reviewed
Feb 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Describe the changes
This PR restores functional audio playback for the Speaker toy by reintroducing a proper PCM based audio pipeline. The Speaker now actively encodes PCM data using Opus, streams audio in real time, and correctly sends voice packets to clients.
Additionally, this PR introduces a complete Audio API overhaul:
-Seeking Support: Added functionality to jump to specific timestamps in both streamed and preloaded audio.
-Event System: Implemented a full lifecycle event system (OnPlaybackStarted, Paused, Resumed, Stopped, Finished, Looped) for better plugin integration.
High Precision: Switched internal time tracking to double precision to ensure accurate playback timing and seeking.
What is the current behavior? (You can also link to an open issue here)
The current Speaker toy is unable to play any audio. Although audio packets can be sent, no actual playback pipeline exists.
What is the new behavior? (if this is a feature change)
The Speaker can now reliably play audio. It supports streamed and preloaded WAV playback, real-time PCM encoding, looping, targeted or global playback modes, and proper cleanup when playback ends or the toy is removed.
-Playback Pipeline: Real time or Preloaded PCM encoding and streaming.
-WAV Support: Support for both streamed and preloaded WAV playback.
-Advanced Controls: Added Seek(double seconds), CurrentTime, and TotalDuration properties.
-Events: Developers can subscribe to playback events to trigger logic when audio starts, stops, or finishes.
-Flexible Modes: Supports Looping, Targeted (specific players ), Predicate players, or Global playback modes.
-Pitch Support: Dynamic playback speed control with optimized interpolation.
-Cleanup: Proper resource disposal when playback ends or the toy is removed.
Example Videos:
2026-01-04.13-03-42.mp4
2026-01-12_01-55-51.mp4
SPOILER_0121.mp4
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No. This change restores and extends existing functionality without requiring changes from users.
Other information:
Types of changes
Submission checklist
Patches (if there are any changes related to Harmony patches)
Other