Solved

WAV file rewind and play

Posted on 2004-04-17
3
511 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

864 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now