audioPlayer

Methods
6
Fields
None

Getting one

audioPlayer

Methods

MethodReturnsDescription
play(File, number)()Play file (in the plugin's directory) at gain dB, now, beside anything playing. A file that is not a WAV this reads is `UnsupportedAudi…
cancel(number)()Stop playback id (or drop it from the queue).
isPlaying(number)booleanWhether playback id is queued or playing.
stopAll()()Stop every sound this plugin plays or queued.
playBytes(string, number)numberPlay wav's bytes (a Luau string, e.g. Asset.bytes("sound.wav")) at gain dB, now, beside anything playing. Returns the playback's id.
enqueue(string, number)numberPlay wav (a Luau string of a WAV's bytes) after every sound this plugin queued before it. Returns the playback's id.

Method details

play

play: (AudioPlayer, File, number) -> ()

Play file (in the plugin's directory) at gain dB, now, beside anything playing. A file that is not a WAV this reads is UnsupportedAudioFileException.

cancel

cancel: (AudioPlayer, number) -> ()

Stop playback id (or drop it from the queue).

playBytes

playBytes: (AudioPlayer, string, number) -> number

Play wav's bytes (a Luau string, e.g. Asset.bytes("sound.wav")) at gain dB, now, beside anything playing. Returns the playback's id.

enqueue

enqueue: (AudioPlayer, string, number) -> number

Play wav (a Luau string of a WAV's bytes) after every sound this plugin queued before it. Returns the playback's id.