{help}mp3 player

Posts 1–15 of 28 · Page 1 of 2
{help}mp3 player
how would i make a mp3 player
Go to Tools > Choose Toolbox Items > Find WindowsMediaPlayer in there somewhere (look in the tabs)
Code:
            AxWindowsMediaPlayer1.Ctlcontrols.Play()
            AxWindowsMediaPlayer1.Ctlcontrols.Pause()
            AxWindowsMediaPlayer1.Ctlcontrols.Stop()
Use any of these in your buttons.
how do i play music
Quote Originally Posted by tremaster View Post
how do i play music
Intellisense mate, it's not even hard. Add an AxWindowsMediaPlayer control to your form and then intellisense makes the rest easy peasy. How about you have a go before asking to be spoonfed?
Ow come on...There is something called Google. You can even find ~20 youtube tutorial about that <.<

Furthermore, the solution was already posted above...
Quote Originally Posted by Blubb1337 View Post
Ow come on...There is something called Google. You can even find ~20 youtube tutorial about that <.<

Furthermore, the solution was already posted above...
I believe his problem is getting the file to play, but that's so easy.

HINT: In this context, location = URL. If you can't figure it out from that and flameswor's post, you should probably think of a new hobby
I need to make a list box and when i click one of the listbox items witch will be a song i want it to play im thinking about if the list box item is click then the song will start help?
Will the listbox contain the actual location of each song or just the song name?
this not real code but example if listbox item.clicked then play location of song here
Quote Originally Posted by tremaster View Post
this not real code but example if listbox item.clicked then play location of song here
Omg can you answer my question? I know WHAT you're trying to do but can you answer the question, will the listbox just have the songs names or the whole path, that'll influence the code behind it -.-
Listbo*****lectedIndexChanged Event

AxWindowsMediaPlayer1.Url = listbox1.selecteditems(0).text

Or .Selecteditem....idk
Well seeing as you're having the name, you might want to do a save setting when you add it to the listbox.

i.e

[php]

Dim OFD As New OpenFileDialog

If OFD.ShowDialog = Windows.Forms.DialogResult.OK then
Dim lio1 As Integer = (OFD.FileName.LastIndexOf("\") + 1)
Dim lio2 As Integer = (OFD.FileName.LastIndexOf(".")

Dim finalName As String = OFD.FileName.Substring(lio1, (lio2 - lio1))
ListBox1.Items.Add(finalName)
SaveSetting("MyMedia", "Songs", finalName, OFD.FileName)
End If
[/php]

Then add this to your ListBox1_SelectedIndexChanged

[php]

AxWindowsMediaPlayer1.URL = GetSetting("MyMedia", "Songs", ListBox1.SelectedItem)
AxWindowsMediaPlayer1.Ctlontrols.Play()

[/php]

Yeah...
it will have the name
Either save the filepath in the .tag of the item or io.path.getfullpath(listbox1.selecteditem)
IO.Path.GetFileName ftw?
Posts 1–15 of 28 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us