djshades2004

Hi,

Could anyone possibly help me get the total length of a mp3 file in mins eg.(2.30) I need to be able to load the values into a listview component.

If anyone could point me into the right direction it would be a great help.

thanks, stu



Re: Visual Basic Express Edition Mp3 Coding

Tall Dude

' Do a 'project' ' add reference' for the Imports

Imports Microsoft.DirectX

Imports Microsoft.DirectX.AudioVideoPlayback

Public Class Form1

Friend WithEvents m_Audio As Audio

Private Sub Button1_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles Button1.Click

m_Audio = New Audio("c:\song.mp3", False)

Dim SongLen As Double = m_Audio.Duration

Dim SongMins As Double = SongLen / 60

MsgBox(SongMins.ToString("00.00") & " Minutes duration")

End Sub

End Class






Re: Visual Basic Express Edition Mp3 Coding

djshades2004

Thats excellent thank you tall dude Smile

Do you have to have the Direct X Sdk installed Ive tried refrencing the direct x, but its not in my com list.





Re: Visual Basic Express Edition Mp3 Coding

Tall Dude

Check the '.net' tab.

It came with my standard VB express install

as far as I can recollect.






Re: Visual Basic Express Edition Mp3 Coding

djshades2004

Yep its in the .net tab,

I really apreciate your help tall dude, Thank you very much Smile





Re: Visual Basic Express Edition Mp3 Coding

js06

Tall Dude,

I tried the code but i got - loaderlock was detected on this line

m_Audio = New Audio("c:\Real.mp3", False)

What does that mean

Thanks

edit - nevermind, i didn't have the directx reference