Page 1 of 1

Tip: Tiny code to play a wav file

Posted: Thu Jan 17, 2002 3:29 am
by BackupUser
Code updated For 5.20+

Restored from previous forum. Originally posted by PB.

If you want to play a wav file without the whole LoadSound route, try this:

Code: Select all

PlaySound_("c:\sound.wav",0,#SND_ASYNC) ; App continues after sound starts.
PlaySound_("c:\sound.wav",0,#SND_SYNC) ; App pauses until sound stops.
Note that there is NO error-checking done if you use this tiny approach, so if
the sound doesn't play for some reason, too bad.


PB - Registered PureBasic Coder


Edited by - PB on 18 January 2002 00:52:04