Using the PLAY command to play "snd" resources asynchronously will work fine. However, if the user performs an interface task, like opening a window, in the custom menus environment while the "snd" resource is playing, the sound could turn into a buzzing sound. If you find that the "snd" plays as a buzzing sound while doing UI tasks, you can solve the problem by first reading in the sound resource from the sound file and writing it to a resource in the structure file. The following code demonstrates how to do so:
PLAY("";0)` Stop any sound currently playing.
If (Test path name($FileName)#Is a document )
ALERT("Could not open the "+$FileName+" sound file.")
$ResourceFileRef:=Open resource file($FileName)
GET RESOURCE("snd ";1555;$SoundResourceData;$ResourceFileRef)
CLOSE RESOURCE FILE($ResourceFileRef)
SET RESOURCE("snd ";17000;$SoundResourceData)
SET RESOURCE NAME("snd ";17000;$FileName)
SET RESOURCE PROPERTIES("snd ";17000;Purgeable resource mask )
PLAY($FileName;0)` Play the sound asynchronously.
ALERT("Could not get the sound resource.")
ALERT("Cound not open the resource file.")