波形设备命令字符串
capability waveaudio<arg> ......can eject,can play,can record,can save,compounddevice,device type,has audio,has video,inputs,outputs,uses files
close waveaudio
cue waveaudio<arg>.......input,output
delete waveaudio<arg>....from position,to position
info waveaudio <arg>......input,file,output,product
open waveaudio<arg>.......alias name,buffer size,shareable
pause waveaudio
play waveaudio<arg>.......from position,to position,fast,repeat,reverse,slow
record waveaudio<arg>.....insert,from position,to position,overwrite
resume waveaudio
save waveaudio<arg>.......[filename]
seek waveaudio<arg> .......to position,to start,to end
set waveaudio<arg>.........any input,any output,audio all off,audio all on,audio left on/off,audio right on/off
                            channels number
status waveaudio<arg>......channels,current track,format tag,input,length
                           length track number,number of tracks ,output,position,position track number
stop waveaudioThe End

解决方案 »

  1.   

    http://expert.csdn.net/Expert/topic/1229/1229518.xml?temp=.0864374
      

  2.   

    BOOL sndPlaySound(
      LPCSTR lpszSound,  
      UINT fuSound       
    );第一个参数传一个空字符串""即可。
      

  3.   

    还要以SND_ASYNC放式播放。(第二个参数)
      

  4.   

    再次调用sndPlaySound函数,第一个参数赋空:
    sndPlaySound vbNullString, &H1
      

  5.   

    谢谢各位,不过我的意思是用sndPlaysound播放的声音,让它中途停下来,传空字符串还是要播完当前的声音才能停住。
      

  6.   

    SND_ASYNC方式播放声音,还没有播放完时可以调用sndPlaySound函数终止播放的,只要文件名是空字符串就行了。
      

  7.   

    Dim aWave() As Byte
    aWave = LoadResData("A", "WAVE")Private Function PlayWave() As Boolean
        Dim r        As Long
        Dim uFlags   As Long
                
        uFlags = SND_ASYNC Or SND_NODEFAULT Or SND_MEMORY 
        r = sndStopSound(0, SND_ASYNC)
        
        r = sndPlaySound(aWave(0), uFlags)
        
    End Functionr = sndStopSound(0, SND_ASYNC)停止当前播放