Solved

how to play sound in vb5?

Posted on 1998-07-29
6
270 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

706 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

18 Experts available now in Live!

Get 1:1 Help Now