|
NAMEplay_audio - Play an audio sampleSYNOPSISnilplay_audio( aid:sample ) play_audio( aid:sample, number:gain ) play_audio( aid:sample, number:gain, function:callback() ) play_audio( aid:sample, function:callback() ) DESCRIPTIONThis function is used to control audio playback. When called it issues a new playback of the specified audio sample that has previously been loaded or synthesised using load_asample .The argument form where a gain is supplied will override any global gain settings on the output device through WORLDID . If a callback is provided, it will be triggered as soon as the underlying audio stack tells us that playback of the sample has finished. This is intended as a way of sequencing playback samples together. Multiple playbacks of the same samples can be running at the same time, limited by the mixing capabilities of the underlying driver stack as well as a compile-time engine limit (32 by default). If a sample fails to queue or mix properly, the function will return false. EXAMPLEfunction play_audio0() local aid = load_asample("test.wav"); play_audio(aid, 0.5); play_audio(aid, function() print("done"); end) end MISUSEfunction play_audio0() play_audio(fill_surface(32, 32, 0, 0, 0), 0.5); end SEE ALSO:pause_audio(3) delete_audio(3) load_asample(3) audio_gain(3)
Visit the GSP FreeBSD Man Page Interface. |