Solved

how to play sound in vb5?

Posted on 1998-07-29
6
271 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
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.

 

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

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…

920 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

15 Experts available now in Live!

Get 1:1 Help Now