Loads and controls short sound effects through sfxlib.
Syntax
Sfx Load id, filename
Sfx Play id
Sfx Play channel, id[, pitch]
Sfx Loop id
Sfx Loop channel, id[, pitch]
Sfx Stop [ id ]
Sfx Stop Channel, channel
Sfx Pause [ id ]
Sfx Pause Channel, channel
Sfx Resume [ id ]
Sfx Resume Channel, channel
status = Sfx Status()
status = Sfx Status( id )
status = Sfx Status( Channel, channel )
Description
Sfx handles short reusable samples. Sfx Load places a decoded sample in an id slot. Sfx Play plays it once, while Sfx Loop repeats it. The channel forms use the channel number first and the loaded effect id second. The optional pitch argument scales playback speed.
With no argument, Sfx Stop, Sfx Pause, and Sfx Resume affect all active sound effects. Sfx Status returns 0 for stopped, 1 for playing, and 2 for paused.
Example
See examples/sfxlib/sfx-load.bas, examples/sfxlib/sfx-play.bas, examples/sfxlib/sfx-loop.bas, examples/sfxlib/sfx-pitch.bas, and examples/sfxlib/showcase.bas.
Differences from QB
See also