* Returns a [[LONG]] {{Parameter|soundHandle&}} value to the sound file in memory. '''A zero value means the sound could not be loaded.'''
* The literal or variable [[STRING]] sound {{Parameter|fileName$}} can be '''WAV, OGG or MP3''' file types.
* '''Always check the handle value returned is greater than zero before attempting to play the sound.'''
* The handle can be used by most of the _SND sound playing functions and statements in QB64 except [[_SNDPLAYFILE]] which plays a sound file directly from the disk and does not use a handle value.
* Handles can be closed with [[_SNDCLOSE]] when the sound is no longer necessary.
* If a WAV sound file won't play, try it using the Windows [[Windows_Libraries#Play_WAV_Sounds|Play WAV sounds library]] to check it or convert the sound file to OGG.
{{PageExamples}}
''Snippet 1:'' Loading a sound file to use in the program later. Only load it once and use the handle any time you want.
{{CodeStart}}
h& = {{Cl|_SNDOPEN}}("dog.wav")
IF h& = 0 THEN BEEP ELSE {{Cl|_SNDPLAY}} h& 'check for valid handle before using!
{{CodeEnd}}
''Snippet 2:'' Playing a sound from 2 different speakers based on program results.
{{CodeStart}}
Laff& = {{Cl|_SNDOPEN}}("KONGlaff.ogg") 'load sound file and get LONG handle value
{{Cl|IF}} LaffX! < -1 {{Cl|THEN}} LaffX! = -1 'set full volume to left speaker
{{Cl|IF}} LaffX! > 1 {{Cl|THEN}} LaffX! = 1 'set full volume to right speaker
{{Cl|_SNDBAL}} Laff&, LaffX! 'balance sound to left or right speaker
{{Cl|_SNDPLAY}} Laff& 'play sound
{{CodeEnd}}
''Example:'' Playing a file and controlling playback: