Page 2 of 2

Re: au files format specification

Posted: Tue Jul 09, 2013 7:04 pm
by steve
fmiyara wrote:I hope in a future to have all processing done inside Audacity, but for the time being, some processing must be done using specific software such as Matlab, Scilab or Octave. I find it cumbersome having to export and import audio in whatever format (wav, pcm) to have it available outside the Audacity environment, when a script out there could read and process an Audacity project and return a valid Audacity project.
Audacity handles metadata in the .AUP file, not the .AU files.
Audacity handles labels in the .AUP file, not in the .AU files.
I'm aware of that. However, importing a WAV file with, for instance, cues or notes, doesn't result in the inclusion of cues as labels in the .AUP; and, conversely, .AUP labels are not exported to .WAV. Cues or whatever time-related marks are most interesting for measurement documentation purposes, musical analysis, phonetic analysis, bioacoustics, and so on.
You'll need to do some fairly heavy hacking to get into those areas, so why not access the audio data directly from the project rather than via its external files?
There are various ways that you could do that, for example you could add a "dummy" effect that simply pipes audio data to/from the selected track(s) to your external code, or you could create a Nyquist plug-in to read/write audio data to/from a specified location, or you could use mod-script-pipe. Hacking into the external project files just seems to be a rather cumbersome and error prone approach if you don't mind me saying.

Re: au files format specification

Posted: Wed Jul 10, 2013 8:55 am
by fmiyara
I think I have now a better understanding of the .au format.

Bytes . . . . . . . . . . . Content
---------------------------------------------------------------------------------------------------------------------------------------
4 . . . . . . . . . . . . . "dns." [exact reverse of .snd, the "magic number" of the Sun Microsystem's .au]
4 . . . . . . . . . . . . . Little endian hex Offset to audio data
4 . . . . . . . . . . . . . 0xFFFFFFFF [code to describe unknown --may be irrelevant?-- length]
4 . . . . . . . . . . . . . 0x06000000

Code: Select all

  
 4 . . . . . . . . . . . . . Little endian hex version of sampling rate in Hz
 4 . . . . . . . . . . . . . Little endian hex version of number of interleaved channels 
 8 . . . . . . . . . . . . . "Audacity"
12 . . . . . . . . . . . . "BlockFile112"     [Why "112"?]    
Offset - 44 . . . . . . . 1/85 subsampling of audio data, presumably for quick waveform rendering at very low zoom
File_size - Offset . . . Audio in  32 bit IEEE-754 floating point

May be the code of number format is different for a different precision setting.