Reapz Posted May 20, 2003 Posted May 20, 2003 Streamreading an MP3 file... Ok, if I open up an MP3 file in Wordpad then I'm presented with a whole bunch of ASCII characters. I'm trying to do the same in VB.NET using the following 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 I'm a bit confused so I need someone to point out what is probably an extremely obvious solution for me. :D Cheers! Quote I'm getting the hang of this now... No really I am!
*Gurus* divil Posted May 20, 2003 *Gurus* Posted May 20, 2003 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 doesn't understand characters over 127. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Reapz Posted May 20, 2003 Author Posted May 20, 2003 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 wouldn't show it. Cheers. Quote I'm getting the hang of this now... No really I am!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.