GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
play_audio(3) Arcan Lua API play_audio(3)

play_audio - Play an audio sample

nil
play_audio( aid:sample )
play_audio( aid:sample, number:gain )
play_audio( aid:sample, number:gain, function:callback() )
play_audio( aid:sample, function:callback() )

This 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.

function play_audio0()
      local aid = load_asample("test.wav");
      play_audio(aid, 0.5);
      play_audio(aid, function() print("done"); end)
end

function play_audio0()
      play_audio(fill_surface(32, 32, 0, 0, 0), 0.5);
end

pause_audio(3) delete_audio(3) load_asample(3) audio_gain(3)

June 2022 audio

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.