Streamreading an MP3 file (VB)

Reapz

Well-known member
Joined
Dec 15, 2002
Messages
74
Streamreading an MP3 file...

Ok, if I open up an MP3 file in Wordpad then Im presented with a whole bunch of ASCII characters. Im trying to do the same in VB.NET using the following code...

Code:
Dim mp3file As IO.StreamReader = New IO.StreamReader(New IO.FileStream(mp3path, IO.FileMode.Open), System.Text.Encoding.ASCII)
Dim mp3data = mp3file.ReadToEnd
rtb1.Text = mp3data
mp3file.Close()

The problem is that mp3data always comes out as just the first 4 characters, which are ID3, and nothing else. I only ever work with normal text files so Im a bit confused so I need someone to point out what is probably an extremely obvious solution for me. :D

Cheers!
 
Textboxes are meant to display textual data, not binary. There is a hex viewing control in the framework that would probably be more suited to this task.

Try using a different encoding to read the data, ASCII I believe doesnt understand characters over 127.
 
LOL the RTB was only there so I could keep an eye on output and it turned out to be working fine but as you said the RTB wouldnt show it.

Cheers.
 
Back
Top