Interface ClientReceiveSoundEvent
- All Superinterfaces:
ClientEvent, Event
- All Known Subinterfaces:
ClientReceiveSoundEvent.EntitySound, ClientReceiveSoundEvent.LocationalSound, ClientReceiveSoundEvent.StaticSound
This event is emitted before the sound is played on the client.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptiongetId()short[]The unencoded audio data.voidsetRawAudio(short[] rawAudio) Overrides the actual audio data that is played.Methods inherited from interface ClientEvent
getVoicechatMethods inherited from interface Event
cancel, isCancellable, isCancelled
-
Method Details
-
getId
UUID getId()- Returns:
- the ID of the channel
-
getRawAudio
short[] getRawAudio()The unencoded audio data.
Returns an empty array in case of the end of transmission- Returns:
- the raw 16 bit PCM audio frame
-
setRawAudio
void setRawAudio(@Nullable short[] rawAudio) Overrides the actual audio data that is played.This is ignored, if the
getRawAudio()array is empty
Providing audio that's not 960 samples will be ignored. An empty array ornullskips this frame, which adds latency. To mute the audio, use an array filled with zeros instead.- Parameters:
rawAudio- the raw 16 bit PCM audio frame
-