Solved

WAV file rewind and play

Posted on 2004-04-17
3
507 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
Comment Utility
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
Comment Utility
Oops, remove the additional ", bExecuting As Boolean". Forget to remove some portions when testing. :]
0
 

Author Comment

by:aftab2003
Comment Utility
Perfect - Thank you very much
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now