EXILED
EXILED copied to clipboard
[Resonance] AudioPlayer API
Additions
-
[Exiled::API]
AudioFile
Class, Represents an audio file that can be used by the Audio Player. (idea taken from swd) -
[Exiled::API]
AudioStream
class extension for the audio player, allows the audio player to play audios from a URL. -
[Exiled::API]
AudioPlayer
Main Class, used only on NPCs, used to play audios through them. -
[Exiled::API]
AudioFinishedEventArgs
, invoked when the audio that is being played ends. -
[Exiled::API]
SelectingAudioEventArgs
, invoked before selecting an audio file (can be denied). -
[Exiled::API]
AudioSelectedEventArgs
, invoked after selecting an audio file.
TODO
- [x] Play method for the
AudioPlayer
class that will play anAudioFile
. - [x] Audio Playback
- [x] Stop Handling to stop the current audio.
- [x] Update method to ensure that the audio is being transmited to everyone every frame.
- [x] OGG Audio File parsing (Self parser or NVorbis)
- [ ]
AudioStream
class that will allow the use of Urls for the AudioPlayer
Example API Usage
Npc npc = Npc.Spawn("UPlayer", RoleTypeId.CustomRole, 100, "exileddev@audioplayer");
AudioPlayer audioPlayer = AudioPlayer.GetOrCreate(npc);
audioPlayer.Enqueue(EntryPoint.Instance.Config.TestFile); // Test File ends up being an AudioFile class.
audioPlayer.Play();