Share via


SndPlayAsync

4/8/2010

This function starts asynchronous playback of a sound.

Note

This call will be successful only if the sound is not already playing.

Syntax

HRESULT SndPlayAsync (
   HSOUND hSound,
   DWORD dwFlags
);

Parameters

  • pszSoundFile
    [in] The sound to play.

    Note

    The sound handle was created using function SndOpen.

  • dwFlags
    Indicates playback options.

    Note

    Currently, the only flag supported is SND_PLAY_IGNOREUSERSETTINGS, so dwFlags can be either 0 or SND_PLAY_IGNOREUSERSETTINGS.

Return Value

The function returns S_OK if successful, returns E_HANDLE if the sound handle is currently used for playing a sound, otherwise returns a standard HRESULT error code. If any flag besides SND_PLAY_IGNOREUSERSETTINGS are set through parameter dwFlags, the function will return E_INVALIDARG.

Remarks

You should call function SndStop to terminate the asynchronous sounds on your process before your application exits.

Requirements

Header soundfile.h
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Windows Mobile 6 Classic and later, Windows Mobile 6 Professional and later, Windows Mobile 6 Standard and later

See Also

Concepts

Sounds Reference