I know there is a number of ways to play wavefiles...
How can I know when a file is done so I can make it play a different file in VB; always contiguous.
If anyone knows, I would appreciate it.
Printable View
I know there is a number of ways to play wavefiles...
How can I know when a file is done so I can make it play a different file in VB; always contiguous.
If anyone knows, I would appreciate it.
Im not even sure if MediaPlayer plays wavs but if it does:
MediaPlayer1_EndOfStream(all the parameters)
Mediaplayer1.Play
End Sub
Play it synchronously, then the next line of code will only run when the WAV is finished.
Do you mean use sndplay sound. I thought you could not play big wave files.........30 meg with sndplaysound.
To the person on the top........Thanks...........but can you play different sounds at the same time as the mmcontrol is playing.....
Take advantage of the Done event.
Before I issue the play command, I set a flag and then reset it in the Done event routine.
[code]
somewhere in the code of my doorprize drawing app:
If frmMain.mnuSound.Checked = True Then
bWaveFinished = False
' select a sound clip
iFileNum = iSelection Mod 8
MMControl.filename = App.Path & "\WINNER" & iFileNum & ".WAV"
MMControl.Command = "Open"
MMControl.Command = "Play"
While bWaveFinished = False
DoEvents
Wend
End If
.
.
Private Sub MMControl_Done(NotifyCode As Integer)
' Close the MCI
MMControl.Command = "Close"
bWaveFinished = True
End Sub
[\code]