English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hi ppl.. can anyone tel me how to write code to play songs in Vb.. i know there is this control which has all the play,pause,stop etc.. but where can i store these songs in the backend and how do i connect it to the buttons.. i should be able to put the song list in the list box and when the user selects the song and plays it, he must be able to pause, stop, rewind etc and how do i proceed.. do help me...

2007-01-12 01:17:16 · 6 answers · asked by savi 3 in Computers & Internet Programming & Design

6 answers

Check out http://www.pscode.com - I was just doing a project simmilar to this, and found that site to be full of excellent examples.

2007-01-12 04:12:02 · answer #1 · answered by Richard H 7 · 0 0

The control can be accessed from the Visual Basic IDE as
Goto Projects>Components
in this window select Microsoft Multimedia control 6.0
click apply.
You should see the MMControl in the toolbar just drag & drop on the form & now u'll see all the buttons (ie play, stop, pause etc) bingo half work done.
now add a common dialog control(for selecting the file) & a listbox.
I'm not going to show how to use the common dialog control instead i'm concentrating on the MMControl part.
Declare a string variable

Dim strfilename As String

which contains the filename obtained from the common dialog control.
Now comes the core part

To play the songs simply code as

Form1.MMControl1.FileName = strfilename
Form1.MMControl1.Command = "Open"
Form1.MMControl1.Command = "Play"

assuming control name is MMControl1
the song would start playing rest controls are handled by windows only but rewinding & forwarding require more bit of coding and i have no idea about it.

to add the song name to the list box simply type

Form1.List1.AddItem strfilename, 0

assuming listbox name is List1.
Each filename needs to added manually to the list
so u can maintain a counter like

Form1.List1.AddItem strfilename, index1
index = index + 1
to keep adding files in the list box.

do not forget to close the MMControl as
MMControl1.Command = "Stop"
MMControl1.Command = "Close"

Good Luck for your project :)

2007-01-15 00:30:46 · answer #2 · answered by saurabh b 2 · 0 0

Read the documentation for the media player component you are talking about - all the specific usage details should be there.

If you don't know how to connect a piece of code to a button yet, I suggest you read some VB tutorials and practice simple things like that first before taking on your media player project. Without those simple skills even a simple project like yours can quickly turn into an absolute minefield of code.

2007-01-12 01:33:21 · answer #3 · answered by Anonymous · 0 0

Mairsey Sound (it truly is Scouse for Mersey). Beatles, Gerry and the Pacemakers, Rory typhoon and the Hurricanes. did not take to Freddie and the Dreamers, yet it truly is a Scouse problem as well. the perfect problem to come back out of Manchester became the M62.

2016-10-17 01:01:21 · answer #4 · answered by ? 4 · 0 0

its msdxm.ocx, if you want i can send you complete application, i have written to run media.

2007-01-12 01:58:47 · answer #5 · answered by ANKI 1 · 0 0

sorry

2007-01-12 01:26:52 · answer #6 · answered by Anonymous · 0 2

fedest.com, questions and answers