hugas

I was creating few topics like that before. but nobody didn't explained me, how do i play mp3 in my applications... these long tutorials are too hard for me.Please just tell me, when i put WindowsMediaPlayer1 in my form, how do i make that the mp3 song from my resources would start playing


Re: Visual Basic Express Edition Using windows media player

clint

Private Sub Form1_Load(ByVal sender As Object, _

ByVal e As System.EventArgs) Handles Me.Load

Dim b As Byte() = My.Resources.Little_Richard___The_Best_Of_Little_Richard___09___Baby_Face

Dim TheFIlePath As String = "My.Resources.babyface.mp3"

Dim TempFile As System.IO.FileStream = IO.File.Create(TheFIlePath)

TempFile.Write(b, 0, b.Length)

TempFile.Close()

wmp.URL = (TheFIlePath)

End Sub

there ya go

clint






Re: Visual Basic Express Edition Using windows media player

hugas

what is TheFIlePath what should i enter there




Re: Visual Basic Express Edition Using windows media player

clint

nothing

just alter these two lines to the name of your mp3

Dim b As Byte() = My.Resources.Little_Richard___The_Best_Of_Little_Richard___09___Baby_Face

Dim TheFIlePath As String = "My.Resources.babyface.mp3"






Re: Visual Basic Express Edition Using windows media player

hugas

error says:
name 'wmp' is not declared.




Re: Visual Basic Express Edition Using windows media player

clint

sorry

change the name of your axwindowsmediaplayer to wmp

or change wmp to axwindowsmediaplayer

put these two lines at the very top of your code

Imports AxWMPLib

Imports WMPLib