Solved

how to play sound in vb5?

Posted on 1998-07-29
6
280 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

739 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