EDN Admin
Well-known member
Hi!
This is how I currently find the ID3 Tags in a .mp3 files, but is there a way to do it that doesnt involve Byte arrays?
<pre class="prettyprint lang-vb Private Sub GetID3Tags(ByVal Path As String)
Dim Stream As IO.FileStream
Dim Title(30) As Byte
Dim Artist(30) As Byte
Stream = New IO.FileStream(Path, IO.FileMode.Open)
Stream.Seek(-125, IO.SeekOrigin.End)
Stream.Read(Title, 0, 30)
Stream.Seek(-95, IO.SeekOrigin.End)
Stream.Read(Artist, 0, 30)
Stream.Close()
Dim TxtTitle As String = System.Text.Encoding.ASCII.GetString(Title)
Dim TxtArtist As String = System.Text.Encoding.ASCII.GetString(Artist)
Add The Info
SongTitles.Add(TxtTitle)
SongArtists.Add(TxtArtist)
DummyTitles.Add(TxtTitle)
DummyArtists.Add(TxtArtist)
End Sub[/code]
<br/>
View the full article
This is how I currently find the ID3 Tags in a .mp3 files, but is there a way to do it that doesnt involve Byte arrays?
<pre class="prettyprint lang-vb Private Sub GetID3Tags(ByVal Path As String)
Dim Stream As IO.FileStream
Dim Title(30) As Byte
Dim Artist(30) As Byte
Stream = New IO.FileStream(Path, IO.FileMode.Open)
Stream.Seek(-125, IO.SeekOrigin.End)
Stream.Read(Title, 0, 30)
Stream.Seek(-95, IO.SeekOrigin.End)
Stream.Read(Artist, 0, 30)
Stream.Close()
Dim TxtTitle As String = System.Text.Encoding.ASCII.GetString(Title)
Dim TxtArtist As String = System.Text.Encoding.ASCII.GetString(Artist)
Add The Info
SongTitles.Add(TxtTitle)
SongArtists.Add(TxtArtist)
DummyTitles.Add(TxtTitle)
DummyArtists.Add(TxtArtist)
End Sub[/code]
<br/>
View the full article