BB___PLAYWAVE

=PLAYWAVE= toc

Description
> This command will play a sound file (wav). The playing mode is optional. if the external file is missing the default Windows alert will be played (defined in your Windows sound scheme). > Only one wav file will play at a time, subsequent playing will override the previous sound.


 * media type="file" key="BB___example.wav" ||

Hints
>

Example
//This example uses the WAV sound file from this article. Save it to a folder of your choice and run this code from the same folder.// code format="lb"

'If the bb___example.wav is missing, the default Windows beep will play instead. '

button #main.b1 "PlayWave /asynch",[doPlayA],ul,10,10 button #main.b2 "PlayWave /synch",[doPlayB],ul,10,50 button #main.b3 "PlayWave Start Loop",[doPlayC],ul,10,90 button #main.b3 "Stop!",[doPlayD],ul,10,140

open "Just BASIC - Playwave" for window_nf as #main #main "trapclose [quit]" wait

[doPlayA] playwave "bb___example.wav", asynch wait

[doPlayB] playwave "bb___example.wav", synch wait

[doPlayC] playwave "bb___example.wav", loop wait

[doPlayD] playwave "" wait

[quit] close #main end

code

Useful Functions
code format="lb" Place a useful function using this keyword here code