Solved

how to play sound in vb5?

Posted on 1998-07-29
6
273 Views
Last Modified: 2010-05-03
hi guys,
how to play the midi sound / mp3 sound in vb5?

thanx alot
0
Comment
Question by:michaelair
  • 4
  • 2
6 Comments
 
LVL 1

Accepted Solution

by:
Jason_G earned 80 total points
ID: 1467122
Hi michaelair,
To play sound in VB 5, you have to use the Multimedia Control, if you want more information on how to use this, go to VB's Books Online, and type Using the Multimedia Control, it will show you how to use it.

I hope this helps, if you need any more information just add a comment.

Sincerely,
Jason

Jason Gorman (jason_gorman@scholars.com)
Learning Advisor, scholars.com
Microsoft Authorized Technical Education Center
Novell Authorized Online Training Provider
http://scholars.com
0
 
LVL 1

Expert Comment

by:Jason_G
ID: 1467123
Hi michaelair,
A change to my note above, in the Books Online, search area, simply type multimedia control, and the article you need to click on after typing that in is Using the Multimedia Control.

Good luck!

Sincerely,
Jason

Jason Gorman (jason_gorman@scholars.com)
Learning Advisor, scholars.com
Microsoft Authorized Technical Education Center
Novell Authorized Online Training Provider
http://scholars.com
0
 
LVL 1

Expert Comment

by:Jason_G
ID: 1467124
Hi michaelair,
here is some sample code to get you started;

The following example illustrates the procedure used to open an MCI device with a compatible data file. By placing this code in the Form_Load procedure, your application can use the multimedia MCI control “as is” to play, record, and rewind the multimedia file DING.WAV. To try this example, first create a form with a multimedia MCI control.

Private Sub Form_Load ()
      ' Set properties needed by MCI to open.
      Form1.MMControl1.Notify = FALSE
      Form1.MMControl1.Wait = TRUE
      Form1.MMControl1.Shareable = FALSE
      Form1.MMControl1.DeviceType = "WaveAudio"
      Form1.MMControl1.FileName = "C:\WINDOWS\DING.WAV"

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

To properly manage multimedia resources, you should close those MCI devices that are open before exiting your application. You can place the following statement in the Form_Unload procedure to close an open MCI device before exiting from the form containing the multimedia MCI custom control.

Private Sub Form_Unload ()
      MMControl1.Command = "Close"
End Sub

This should help you get started with the coding.

Good luck.

Sincerely,
Jason

Jason Gorman (jason_gorman@scholars.com)
Learning Advisor, scholars.com
Microsoft Authorized Technical Education Center
Novell Authorized Online Training Provider
http://scholars.com
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

Author Comment

by:michaelair
ID: 1467125
and then for mp3 files?
0
 
LVL 1

Expert Comment

by:Jason_G
ID: 1467126
Hi michaelair,
To use Mp3 files, you could put an ole control on your form, then when it prompts you for a file, browse to an mp3 file, then when you run your project, it will automatically launch WinAmp, or whatever player you use to play MP3's.

If you need more information just ask.

Good luck.

Sincerely,
Jason

Jason Gorman (jason_gorman@scholars.com)
Learning Advisor, scholars.com
Microsoft Authorized Technical Education Center
Novell Authorized Online Training Provider
http://scholars.com
0
 

Author Comment

by:michaelair
ID: 1467127
thanx alot..
next time if i hav any doubt ,can i staright send email 2 u ?
thanx again

0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel Vlookup to move data back to source. 4 90
Run code from text file in vb 1 64
Add a task in Outlook from access 11 39
Child Form in front 4 46
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…
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 …
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…

785 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