I am using this code to play a wav file:
How can I find if the wav file is play has finished? Also, can I just get the Filename of the file playing, not the whole path, to put in a label? Thanks.Code:'In the Module Declare Function PlaySound Lib "winmm.dll" _ Alias "PlaySoundA" (ByVal lpszName As String, _ ByVal hModule As Long, ByVal dwFlags As Long) As Long 'And this in the form Dim LoadedFile As String Private Sub Command1_Click() 'Play wav PlaySound LoadedFile, 0&, &H1 End Sub Private Sub Command2_Click() 'Stop wav PlaySound LoadedFile, 0&, &H4 End Sub Private Sub Command3_Click() CommonDialog1.Filter = "WAV File (*.wav)|*.wav|All Files (*.*)|*.*|" CommonDialog1.ShowOpen LoadedFile = CommonDialog1.FileName End Sub Private Sub Command4_Click() PlaySound LoadedFile, 0&, &H4 Unload Me End Sub Private Sub Form_Load() LoadedFile = "C:\Windows\Media\The Microsoft Sound.wav" Call Command1_Click End Sub


Reply With Quote