forked from Exiled-Official/EXILED
-
Notifications
You must be signed in to change notification settings - Fork 106
feat: Speaker Api #711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MS-crew
wants to merge
19
commits into
ExMod-Team:dev
Choose a base branch
from
MS-crew:SpeakerToyReborn
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: Speaker Api #711
+725
−5
Conversation
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
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
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.
Cleanup: Proper resource disposal when playback ends or the toy is removed.
Example usages:

2026-01-04.13-03-42.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