MathGroup Archive 2010

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

Search the Archive

WAV Import[] and Integer16 Issue

  • To: mathgroup at
  • Subject: [mg115086] WAV Import[] and Integer16 Issue
  • From: telefunkenvf14 <rgorka at>
  • Date: Thu, 30 Dec 2010 06:28:52 -0500 (EST)


(Version 8, Windows 7 64-bit)

Consider the case of importing a 16-bit WAV file, with correctly
formed header info.

If I evaluate: Import["someAudio.wav", "AudioEncoding"], Mathematica
tells me, as expected, that I'm dealing with AudioEncoding ->
Integer16 data.

Now, can anyone explain why Import["someAudio.wav", "Data"] would fail
to return a list of integers?!? (returns a scaled float)

Searching MathGroup lead me to ReadSoundFile["someAudio.wav"], a
function contained the Audio package. (Note: I'm pretty sure you won't
find this function anywhere in the documentation or Audio package
tutorial, although Mathematica will spit out a usage message if asked). This
function imported the 16-bit file exactly as it should have, as
Integer16 data, and I was able to verify the header information by
including the option PrintHeader->True.

BinaryReadList["someAudio.wav, "Integer16"] also works as expected,
but then one has to manually chop off the WAV header data. (not an
easy task---as an example, different parts of the header use different
endian formats.)

Can anyone confirm the behavior when importing a 16-bit WAV file? Is
this a bug or by design?


  • Prev by Date: MathieuCharacteristicA strange behaviour
  • Next by Date: Re: Manually culling a list
  • Previous by thread: MathieuCharacteristicA strange behaviour
  • Next by thread: Re: WAV Import[] and Integer16 Issue