[SciPy-User] parsing a wave file

David Hutto smokefloat@gmail....
Thu Feb 23 05:04:21 CST 2012


Hi,
I'm using scypy 0.10.1RC2 amd 64 with python 2.7.
I'm attempting to parse a wav file to access the data chunks to show
the values for use
in an oscilloscope(to know the intended usage, and maybe  a better way
to go about the solution).

The following code:
.

####################
	        f = Sndfile(r'c:\Users\david\test01.wav', 'r')
		fs = f.samplerate
		nc = f.channels
		enc = f.encoding
		data = f.read_frames(1000)
		frame_amount = 1000
		data_float = f.read_frames(frame_amount, dtype=np.float32)
		for i in range(0,frame_amount,1):
			print data_float[i]
	##############
returns data_float[i] in the form:
[-1,0.990988]
[.08545,-0.009988]
etc.

My question is, is this the portion of data I'm parsing for(I'm almost
positive it's not), or is there another data chunk? The graphing of
the given data displays nothing close to the supplied current being
recorded in the wav file.

Any suggestions as to what I'm parsing in the wrong way, or better
solutions than the above?


Thanks,
David


More information about the SciPy-User mailing list