Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multimedia Control in VB 2

Status
Not open for further replies.

charu

IS-IT--Management
May 20, 2001
29
IN
I am a vb beginner .I know how to use multimedia control to listen .wav,.mid files but I want to know how to use multimedia control to listen .mp3 or soundable .avi files .
 
I'm not sure of this, but I think with MM Control 6.0 you can play .mp3 or .avi. I'm almost sure of this, are you using Microsoft Multimedia Control 6.0?
 
Yes ,I am using microsoft multimedia control 6.0.
Then also I am unable to do it.
 
What exactly is the problem then? You don't hear anything or you get an error when opening them?
 
Hi,
While using the multimedia control we need to set device type e.g.device type=waveaudio for wav files.
But for .mp3 files no device Type is specified in MSDN help.If I am using Device Type=others then I don't hear anything.Also it does't give any error
The code I am writing is as follows:
Private Sub Form_Load ()
' Set properties needed by MCI to open.
MMControl1.Notify = FALSE
MMControl1.Wait = TRUE
MMControl1.Shareable = FALSE
MMControl1.DeviceType = "other"
MMControl1.FileName = "C:\WINDOWS\MMDATA\GONG.mp3"

' Open the MCI WaveAudio device.
MMControl1.Command = "Open"
End Sub

 
If you want to play mp3 all you need to do is:
MMControl1.Command = "Close" 'To ensure nothing else is playing
MMControl1.FileName = "C:\My Music\anything.mp3"
MMControl1.Command = "Open"

This will work also for .avi. When playing this files you don't need to set the device Type otherwise they won't run.

Hope this helps.
 
Hello,
As per your suggestion, if I am writing the above code for .wav ar .mid files,I can listen these files without specifying device type.But it is not working for .mp3 files.It does't give any error but the multimedia control on form remains disabled in case of .mp3 files.



 
With this code I told you, you still have that problem? Because I've tryed it here and it works ok. If I tryed to set the Device type then the multimedia control would be disabled, but with this code it works fine here on my pc.
 
Hello,
Sorry to say but still my project doesn't work. my multimedia control remains disabled with your code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top