How to get Sound Visual Basic 6.0

Asked By 7060 points N/A Posted on -

I am creating a software in VB 6.0 where I need to play sound. How is it possible please Explain.

Best Answer by Sharath Reddy
Answered By 0 points N/A #82727

How to get Sound Visual Basic 6.0



In Order to Play Sound all you need to do is to use Windows Media player in the VB form.

This is the easiest Procedure.


Click Project –> Components.

Check Windows Media Player.

Click OK.

You see a small icon of windows media player in the toolbar at left.

Drag it to your desktop.

Select properties and In URL property, add the filename you would like to play with Windows Media Player. Here you can play videos too.

In order that you do not want to show the player, then under properties,  Change Visible property to false.

The player is not displayed by the audio you can hear. You can change the mode of play and the filename at runtime too.


Best Answer
Best Answer
Answered By 573505 points N/A #82729

How to get Sound Visual Basic 6.0


Here’s another way of playing audio files using a different version of Visual Basic. This method applies to Microsoft Visual Basic 2005 and or Microsoft Visual Basic .NET. Start it up by creating a Windows application sample.

  • Open Microsoft Visual Basic .NET or Microsoft Visual Basic 2005. Click File, New, and then select Project.
  • In Project Types, select Visual Basic Projects.
  • Click Windows Application under Templates.
  • In Name, enter without quotes “AudioDemo” or any name you like then hit OK. “Form1.vb” will be created automatically and by default.

Next step is to create or add a Windows Media Player control to the program.

  • Open Microsoft Visual Basic .NET or Microsoft Visual Basic 2005 again then go to Tools and then select Add/Remove Toolbox Items.
  • Select COM Components tab and then Browse. Locate and select “Msdxm.ocx” and then click Open. This file is usually located in “c:Windowssystem32”.
  • In Choose Toolbox Item dialog box, click OK.
  • In Visual Studio 2005 or Visual Studio .NET 2003, add a WindowsMediaPlayer control to Form1. And in Visual Studio .NET 2002, add a MediaPlayer control.
  • After this, “AxMediaPlayer1” is added to Form1.

For the rest of the guide like adding buttons, initialization code, code to load an audio file, code to play an audio file, code to pause an audio file, and code to stop an audio file, visit Play audio files using Visual Basic .NET.

Answered By 20 points N/A #82730

How to get Sound Visual Basic 6.0


Hi friends, your comments have left a permanent impression in my mind. I believe self help is the best help; in that case, my efforts were not crowned with success. But guys, my heart swells with expectations, showing your approaching comments. Now, applying your step by step process is very effective and it would help me a lot to understand and perform well and my demand has been met up. I have been successful in playing sound using Windows Media Player in the VB form. Thanks guys once again as well as too.

Login/Register to Answer

Related Questions