Solved

WAV file rewind and play

Posted on 2004-04-17
3
514 Views
Last Modified: 2012-06-22
Hi,

I want to rewind a wav file and play it three or four times. How do I do that ?

The following plays only once :

MMControl1.DeviceType = WaveAudio
MMControl1.Notify = False
MMControl1.Wait = False
MMControl1.Shareable = False

MMControl1.FileName = "C:\1.WAV"
MMControl1.Command = "Open" 'app.Path & 
MMControl1.Command = "PlaY"
'WaitForEventsToFinish 100
MMControl1.Command = "Rewind"
MMControl1.Command = "PlaY"
MMControl1.Command = "Back"
MMControl1.Command = "PlaY"
0
Comment
Question by:aftab2003
  • 2
3 Comments
 
LVL 17

Expert Comment

by:zzzzzooc
ID: 10851586
Rewind is "Prev". The below will play "c:\test.wav" and repeat it 4 times afterwards (total of 5 times).


Form1:
--------------

Private iRepeat As Integer, bExecuting As Boolean
Private Sub Form_Load()
    iRepeat = 4
    MMControl1.DeviceType = WaveAudio
    MMControl1.FileName = "c:\test.wav"
    MMControl1.Command = "Open"
    MMControl1.Command = "Play"
End Sub
Private Sub MMControl1_Done(NotifyCode As Integer)
    If NotifyCode = mciNotifySuperseded Then Exit Sub
    iRepeat = iRepeat - 1
    If iRepeat > -1 Then
        MMControl1.Command = "Prev"
        MMControl1.Command = "Play"
        Debug.Print Timer
    Else
        MMControl1.Command = "Close"
    End If
End Sub
0
 
LVL 17

Accepted Solution

by:
zzzzzooc earned 50 total points
ID: 10853730
Oops, remove the additional ", bExecuting As Boolean". Forget to remove some portions when testing. :]
0
 

Author Comment

by:aftab2003
ID: 10863006
Perfect - Thank you very much
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question