Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: WAV Import[] and Integer16 Issue

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115109] Re: WAV Import[] and Integer16 Issue
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Fri, 31 Dec 2010 04:59:25 -0500 (EST)

Fully agree, David. Every time I want to read, write, or import, I have to
experiment with formats until it comes out right, even reading simple text
files.

That was dead easy in Fortran 5, as I recall from the early 70s.

Bobby

On Thu, 30 Dec 2010 18:05:46 -0600, David Bailey
<dave at removedbailey.co.uk> wrote:

> On 30/12/2010 11:29, telefunkenvf14 wrote:
>> Group:
>>
>> (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?
>>
>> -RG
>>
> I have always thought that that should document Import and Export
> separately for each data type. As it is, the documentation is incredibly
> vague, considering that this functionality is quite important, and
> clearly has consumed much effort within WRI.
>
> David Bailey
> http://www/dbaileyconsultancy.co.uk
>


-- 
DrMajorBob at yahoo.com


  • Prev by Date: Default Lighting for Graphics3D
  • Next by Date: New to Mathematica, need help for Image Processing.
  • Previous by thread: Re: WAV Import[] and Integer16 Issue
  • Next by thread: How to turn off curly quotes in Mathematica 8?