在VB6.0中用sndPlaySoundA播放音乐,怎么把它停下来及把它从内存中清除?

还有为什么当播放模式设为0,总是没有响应,这是不同步播放吗?为什么会这样?... 还有为什么当播放模式设为0,总是没有响应,这是不同步播放吗?为什么会这样? 展开
 我来答
harry0217
2009-07-25 · TA获得超过137个赞
知道小有建树答主
回答量:183
采纳率:0%
帮助的人:143万
展开全部
Windows Multimedia

sndPlaySound
The sndPlaySound function plays a waveform sound specified either by a filename or by an entry in the registry or the WIN.INI file. This function offers a subset of the functionality of the PlaySound function; sndPlaySound is being maintained for backward compatibility.

BOOL sndPlaySound(
LPCSTR lpszSound,
UINT fuSound
);
Parameters

lpszSound

A string that specifies the sound to play. This parameter can be either an entry in the registry or in WIN.INI that identifies a system sound, or it can be the name of a waveform-audio file. (If the function does not find the entry, the parameter is treated as a filename.) If this parameter is NULL, any currently playing sound is stopped.
如果此参数为NULL则停止播放声音。!!!!!!!!!!

fuSound

Flags for playing the sound. The following values are defined.

Value Meaning
SND_ASYNC The sound is played asynchronously and the function returns immediately after beginning the sound. To terminate an asynchronously played sound, call sndPlaySound with lpszSoundName set to NULL.
!!!!!!!!!!异步播放,函数在开始播放后立即返回。调用sndPlaySound函数并将 lpszSoundName 置为NULL停止播放。!!!!!!!!!!

SND_LOOP The sound plays repeatedly until sndPlaySound is called again with the lpszSoundName parameter set to NULL. You must also specify the SND_ASYNC flag to loop sounds.
!!!!!!!!!!循环播放,直至调用sndPlaySound函数并将 lpszSoundName 值为NULL。!!!!!!!!!!

SND_MEMORY The parameter specified by lpszSoundName points to an image of a waveform sound in memory.
SND_NODEFAULT If the sound cannot be found, the function returns silently without playing the default sound.
SND_NOSTOP If a sound is currently playing, the function immediately returns FALSE, without playing the requested sound.
SND_SYNC The sound is played synchronously and the function does not return until the sound ends.
!!!!!!!!!!同步播放

See Also

Waveform Audio, Waveform Functions, PlaySound

Private Const SND_ASYNC = &H1 ' play asynchronously
Private Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound
Private Const SND_MEMORY = &H4 ' lpszSoundName points to a memory file

参考资料: MSDN +自己翻译

推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式