Question Reading wav files as text

SamR

New member
Joined
Nov 26, 2009
Messages
2
Programming Experience
Beginner
Hey Guys,

First post, hope its in the right place!

VB.NET:
        Dim fs As System.IO.FileStream
        Dim r As System.IO.BinaryReader
        Dim buffer(500) As Char

        'Get File
        fs = New System.IO.FileStream("H:\Visual Studio 2008\Projects\ImportWav\song.wav", IO.FileMode.Open)
        r = New System.IO.BinaryReader(fs)

        r.Read(buffer, 0, 500)
        txt1.Text = (buffer)

I thought this code would result in me filling 'txt1' with a bunch of header details (https://ccrma.stanford.edu/courses/422/projects/WaveFormat/) and then the raw audio as binary.

But what actually happens is I get:
"RIFF$@�WAVEfmt "

Any idea what I'm doing wrong?
 
Last edited:
I think you've taken the wrong approch to this situation, I believe what the problem is, is that the Binaryreader function is basically opening your WAV file as an actual Text file

I have never tried something like this, maybe I could run a few trial and errors to figure out how to solve this issue.

But might I ask, why in the world do you want to do this??
 
I want to take the raw audio data and analyze its energy levels; comparing local average energy to instantaneous energy to determine its BPM.

Its getting the raw data I'm finding hard. I'd really appreciate any help anyone can offer.
 
Back
Top