Solved

WAV file rewind and play

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA open file from excel cell 4 44
Spell Check in VB6 13 126
VB6 - Scroll Mouse wheel on Picturebox 13 72
checkbox to hide entire section 10 41
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

856 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