PLAYSOUND                                                         Function

PLAYSOUND(file, hmod, flags)

Description

The PlaySound function plays a sound specified by the specified file, resource, or system event. File is the name of the file to play: using 0 in this argument will stop the current sound. Hmod is usually 0 - if you are using a resource file, it is the handle to the resource. Flags is formed by adding the following flags:

Table 20

Flag

Value

Description

APP

?

Play using specific App

ALIAS

&h00010000

File is a system-event alias in the registry or the WIN.INI file. Not for FILENAME or RESOURCE.

ASYNC

&h00000001

Return after sound begins.

FILENAME

&h00020000

File is a filename.

LOOP

&h00000008

Play until PlaySound is called with file set to 0.

MEMORY

&h00000004

File points to an image of a sound in memory.

NODEFAULT

&h00000002

If sound cannot be found, return silently.

NOSTOP

&h00000010

Yield to another sound.

NOWAIT

&h00002000

Return if driver busy.

RESOURCE

&h00040004

File is a resource ID; Hmod is the instance.

SYNC

&h00000000

PlaySound returns after the sound completes

 

Example

PlaySound "SystemStart",0,&h10000

Sleep 500

PlaySound 0,0,0 'stop it after .5 secs

Output

(sound plays for half a second)

Related Items

WAVEVOLUME