MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

.WAV files - problem reading them

  • To: mathgroup at smc.vnet.net
  • Subject: [mg9813] .WAV files - problem reading them
  • From: Greg Alman <Greg.Alman at rollins.edu>
  • Date: Fri, 28 Nov 1997 05:35:29 -0500
  • Organization: Dept. of Physics, Rollins College, Florida, 32789
  • Sender: owner-wri-mathgroup at wolfram.com

I'm using Mathematica 3.0 for Win95.  

I'm having trouble correctly reading WAVE files (e.g. chimes.wav, which
is part of MS office97).  Outside of Mathematica, my computer will play
them fine.  After loading the `audio` library, I read a file in
Mathematica with

	chimes = ReadSoundfile["c:\\chimes.wav", PrinterHeader -> True];

When I play it and plot the record of amplitude vs. time with

		ListPlay[chimes, SampleRate -> 22050, PlayRange -> All]

I do not see the correct time series nor do I hear the correct sound. 
Something about the read by Mathematica is taking the amplitudes, most
of which should be near the middle of the [-32768, 32768] range, and
converting them to numbers at the extreme ends of the range (i.e.
concentrating them near -32768 and 32768].  

The header info that comes up from ReadSoundfile[] tells me that
chimes.wav contains 16 bit numbers, which I thought was supposed to be
acceptable for ReadSoundfile[] to use.  

I've tried the obvious things like changing settings for the options
PlayRange.  I think the problem is with my understanding of the 
function ReadSoundfile[].  Are there options I need to set (or can set)
that are not mentioned in the on-line help?

By the way, ultimately I'd like to take the list created by
ReadSoundfile and send it through various digital filters I am
designing -- so I need the correct record of amplitude vs. time.  Of
course, it would be nice to listen to the final product...

Thanks, 
Greg Alman
Physics Dept. 
Rollins College


  • Prev by Date: Re: Montecarlo Markov Chain
  • Next by Date: Font/option problem?
  • Previous by thread: APL98 Conference Call for Papers
  • Next by thread: Re: .WAV files - problem reading them