Dear All,
I’m new to this forum.
Does anybody know where one can download a specification of the structure of .au files in the data folder of an Audacity project?
I mean headers, data format and so on.
Thank you in advance
Federico Miyara
Dear All,
I’m new to this forum.
Does anybody know where one can download a specification of the structure of .au files in the data folder of an Audacity project?
I mean headers, data format and so on.
Thank you in advance
Federico Miyara
As far as I’m aware the .au files are headerless one channel PCM audio. The bit format and sample rate is defined by the .AUP file.
Note that the .au files in Audacity projects are “Audacity data files” and not directly related to the “Sun Microsystems” format of the same file extension.
As far as I’m aware the .au files are headerless one channel PCM audio. The bit format and sample rate is defined by the .AUP file.
I’ve been trying to examine the contents of the .au file (sort of reverse engineering). In fact it has a header, it starts with sdn. (I guess it is short for “sound”), then the length of the header, then some information about Audacity, then the samplig rate, then the IEEE 754 32 bit floating point representation of min, max and rms declared in the aup (rms doesn’t seem to be actually rms, I’m afraid). Then the same information is repeated except that rms is shifted 4 bits (multiplied by 16). Then there comes some unrecognized dark matter that may be rather long (about 3 kb) and, finally, the audio data in IEEE 754 format. No footer.
However, this is the result of analyzing a few cases, so I’m not quite certain it is the whole story.
By the way, I need the format so as to be able to generate/read/analyze Audacity porojects with other software, particularly mathematical software such as Matlab, Octave or Scilab. Of course one could use the export/import feature, but I think it is better to do it directly.
We warn people that Audacity is not a WAV editor but an audio production editor. Data sacrifices and deviations are tolerated in order to produce a pleasant sounding show. Scientists are routinely dismayed that sucking a show into Audacity and blowing the same show back out will not always produce a bit-accurate match.
Koz
Here is the official (but very brief) documentation that I could find: http://manual.audacityteam.org/man/Glossary#au
What sort of analysis do you want to do?
To import into Matlab etc. it will probably be easiest to export as raw pcm.
Thank you for that link. However, I agree that this information is too brief.
What sort of analysis do you want to do?
To import into Matlab etc. it will probably be easiest to export as raw pcm.
I want, for instance, to get the audio, modify it and save it in the Audacity native format. Now I know how to retrive de samples, but I’m not sure that if I just save the output (modified) ones where I think they go, I always will get compatible au files.
I need also to convert back and forth metadata information, such that one can get a wav file with cues and labels readable by other software such as cool edit or adobe audition, or read a wav file and include such metadata as labels in an Audacity project
We warn people that Audacity is not a WAV editor but an audio production editor. Data sacrifices and deviations are tolerated in order to produce a pleasant sounding show.
I think that being an audio production editor is not incompatible with being an excellent tool for any kind of sound processing, including scientific research and advanced measurement. However, I was simply asking for the technical specification of au files. I mean, for instance, something akin to the wav or flac or even the highly proprietary mp3 format that can be easily found on the web.
Scientists are routinely dismayed that sucking a show into Audacity and blowing the same show back out will not always produce a bit-accurate match.
Audacity works internally in 32 bit float format.
By default, when exporting to a lower bit format the output has dither applied. This is usually beneficial for audio work, but for detailed analysis work you may want to turn dither off, or export in 32 bit float format. Dither can be disabled in “Edit > Preferences > Quality”.
Just out of interest - why?
It would be much simpler to work in raw PCM format.
Audacity handles metadata in the .AUP file, not the .AU files.
Audacity handles labels in the .AUP file, not in the .AU files.
Audacity always does everything internally at 32-bit floating. Audacity defaults to Export Dither (noise) to help mask bit translation errors that might otherwise “add up” in an output show and produce audible distortion.
There is a technique whereby you import a “perfect” WAV (for example) show, set Audacity for that exact wav specification, turn dither off and export an identical show except for the filename and datestamp. But then, why bother?
This doesn’t work with compressed file types like MP3 or m4a because they always become damaged in the transition through 32-floating. Audacity is not an MP3 editor.
Koz
Thank you all for the example and its solution.
Just out of interest - why?
It would be much simpler to work in raw PCM format.
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.
I think I have now a better understanding of the .au format.
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
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.