AUP File format information

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
squarefoot
Posts: 7
Joined: Sat Oct 03, 2009 4:01 pm
Operating System: Please select

AUP File format information

Post by squarefoot » Sat Oct 03, 2009 4:07 pm

Hi
I searched high and low for the AUP file format information, but other than the DTD I was not able to get the info I needed. I hope my question here will get answered:

I am writing a tool for working on AUP files from outside of Audacity. Can someone tell me the details of the XML file format.

If that is not possible, at least the following snippet from an actual AUP file (to begin with)

Code: Select all

<waveblock start="6107281">
					<simpleblockfile filename="e0000207.au" len="262144" min="-1" max="1" rms="0.192749"/>
</waveblock>
I need to know what are the attributes such as start, min, max, rms, etc

Thank you
Regards
SF

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: AUP File format information

Post by steve » Sat Oct 03, 2009 4:38 pm

I don't know the full specification, but here's some of it...

e0000207.au that's the data file that is being referenced
start="6107281" is the start position of theis data file (in samples)
len="262144" is the length in samples
min="-1" max="1" rms="0.192749" minimum, maximum and rms values of the samples in the file.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

squarefoot
Posts: 7
Joined: Sat Oct 03, 2009 4:01 pm
Operating System: Please select

Re: AUP File format information

Post by squarefoot » Sat Oct 03, 2009 4:46 pm

Thank you for your reply. I may be asking some dumb questions here, so pls forgive

What is the duration of one sample?

I guess "rms" is the "root mean square" value. I am still learning this (maybe slowly). How does this affect, say the volume of that specific au file?
What does "max" and "min" refer to? Is it to do with the volume? and the rms is a value within that volume range? (Wild guess)

The application I plan to develop is to use the information in the AUP file to externally mix the AU files using ecasound on Linux boxes.

How do I stitch up each of those au files in the AUP xml file and bring out the final mix using ecasound?

Thanks
Regards
SF

billw58
Forum Staff
Posts: 5600
Joined: Wed Aug 12, 2009 2:10 am
Operating System: macOS 10.15 Catalina or later

Re: AUP File format information

Post by billw58 » Sat Oct 03, 2009 5:49 pm

Code: Select all

<wavetrack name="Narration" channel="2" linked="0" mute="0" solo="0" height="154" minimized="0" rate="44100" gain="1" pan="0">
		<waveclip offset="18.55777090">
			<sequence maxsamples="524288" sampleformat="131073" numsamples="780681">
				<waveblock start="0">
					<simpleblockfile filename="e00008d7.au" len="337046" min="-0.778839" max="0.725403" rms="0.090997"/>
				</waveblock>
				<waveblock start="337046">
					<simpleblockfile filename="e0000c1a.au" len="443635" min="-0.711731" max="0.792633" rms="0.114152"/>
				</waveblock>
			</sequence>
			<envelope numpoints="1">
				<controlpoint t="17.702494331066" val="1.000000000000"/>
			</envelope>
		</waveclip>
Disclaimer: this is only what I can infer from the above snippet - I haven't been able to find a specification of the Audacity XML format.

Wavetrack: a track in Audacity
In this case, the track is named "Narration", [don't know what 'channel="0"' and 'linked="0"' mean], it is not muted or soloed, its height on the screen is 154 pixels, it is not minimized, its sample rate is 44100 samples per second, its gain is set to 1, and its pan is set to 0 (panned to the middle).

Waveclip: a clip within a track. A track may contain many clips, but will always contain at least one.
In this case this waveclip is offset 18.55777090 seconds from the start of the track

Sequence: begins a series of waveblocks (?)
Maxsamples is (?) the maximum number of samples a waveblock (?) can contain. Don't know what the 'sampleformat' codes are, but this one means 16-bit integer PCM. Numsamples is the number of samples in the sequence.

Waveblock: a block of audio - seems to usually (or always?) contain one simpleblockfile or aliasblockfile
Start is the start time (in samples) from the start of the sequence.

Simpleblockfile: finally we're down to specifying the .au files contained in the track
Filename is simply the filename of the simpleblockfile. Note that the path is incomplete. If this Narration.aup file was in a folder named "NarrationFolder" then the complete path for this file (remember, this is an example!) is "NarrationFolder/Narration_data/e00/d00/e00008d7.au". Also note that these .au files (as per my understanding) have a header containing data for drawing the waveform on the screen.
Len is the length of the audio in samples. The length of one sample is the inverse of the sample rate of the wavetrack.
Min is the minimum peak value of the audio in the file, max is the maximum peak value of the audio in the file. rms is indeed the root-mean-square value of the audio in the file, probably the maximum.

Envelope: if the track has an active volume envelope the control points for the envelope will be specified here.

And that's what I can surmise. Perhaps someone who really knows can correct or confirm my assumptions.

Good luck with your project.

-- Bill

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: AUP File format information

Post by steve » Sat Oct 03, 2009 6:15 pm

squarefoot wrote: What is the duration of one sample?
That depends on the sample rate.
The "sample" itself has no duration - it's just a number.
When audio is converted to digital data, it is "sampled" (measured) several thousand times each second. The number of samples that are taken each second is called the "sample rate".
For CD quality sound, the sample rate is 44100 samples per second.

If you record at 44100 samples per second (also called 44100Hz or 44.1 kHz) then to play back the data so as to reconstruct the sound, you will need to convert the samples back at the same rate - so the time between one sample and the next will be 1/44100 or 0.000022676 seconds.
squarefoot wrote:What does "max" and "min" refer to?
Each sample is a measurement of the amplitude of the (analogue) sound signal, measured on a scale of +1.0 to -1.0.
Each sample will lie within this range. The min and max refer to the lowest and highest values for any sample in the file.
The rms is the "root mean square" (average) value of all the samples in the file.
squarefoot wrote:How do I stitch up each of those au files in the AUP xml file and bring out the final mix
Play it in Audacity ;)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

kozikowski
Forum Staff
Posts: 69369
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: AUP File format information

Post by kozikowski » Sat Oct 03, 2009 6:20 pm

<<<[don't know what 'channel="0"' and 'linked="0"' mean]>>>

Channel 0 in English is "Left." Did you note that the code is for Left on top and Right on the bottom?

Here's that really, really, really simple AUP file I produced and then captured as a graphic. I put extra spaces and carriage returns in to make it clearer.

http://kozco.com/tech/audacity/aup1.jpg

I opened up one music file (the famous piano2.wav) saved the project, and then went for a cuppa. So that's as simple a project as you can get, and it's good for getting a handle on what the basic parts do. The sample is in 48000, 16-bit and it's full-on stereo.

Koz

kozikowski
Forum Staff
Posts: 69369
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: AUP File format information

Post by kozikowski » Sat Oct 03, 2009 6:33 pm

RMS is Root Mean Square. That, stripped of the Engineering is how loud the signal is -- in a fuzzy way. The sound level meters will not do that because they follow the digital peak values of the sound. Notoriously unreliable.
This is the one and only place where the US type VU meters shone. They would measure, roughly again, RMS value of the show and could be relied upon to gauge loudness.

RMS is the energy of the waveform, not the peak value. In the US, the peak value of the power coming out of the wall socket is just over 300 volts, but it's the RMS value (horsepower) of 120 volts that actually turns motors and makes the lifts (elevators) go up and down.

I'm surprised that value is in there and it leads me to think that's not what RMS really means in this case.

Koz

billw58
Forum Staff
Posts: 5600
Joined: Wed Aug 12, 2009 2:10 am
Operating System: macOS 10.15 Catalina or later

Re: AUP File format information

Post by billw58 » Sat Oct 03, 2009 7:03 pm

stevethefiddle wrote:
squarefoot wrote:How do I stitch up each of those au files in the AUP xml file and bring out the final mix using ecasound
Play it in Audacity ;)
Yes, that occurred to me too. Just why do you need to play the mix in ecasound?

-- Bill

squarefoot
Posts: 7
Joined: Sat Oct 03, 2009 4:01 pm
Operating System: Please select

Re: AUP File format information

Post by squarefoot » Sat Oct 03, 2009 9:18 pm

Thank you all for your detailed replies.

I am working on a project (it's an experiment actually) where I want to put the AUP file and its data folder on a server, and then I plan to make an app (calling ecasound) on the server which parses the AUP file, use the .AU files, etc in order to produce the final mixed file. Such an app will not play the final mixed version on the server. It will simply piece together the final mixed version and make the final audio file. Since Audacity is a GUI program, it would not be suitable for the server machine.

Hmmm....the obvious solution to this could be this: If Audacity can also be run as a command line version, just to produce the final mixed file, that would be neat. It would remove my need to write a separate ecasound script and I need not even get into the AUP file-format

However, when I checked this is what the Audacity man page recommends:
Audacity is primarily an interactive, graphical editor, not a batch-
processing tool. Whilst there is a basic batch processing tool it is
experimental and incomplete. If you need to batch-process audio or do
simple edits from the command line, using sox or ecasound driven by a
bash script will be much more powerful than audacity.

squarefoot
Posts: 7
Joined: Sat Oct 03, 2009 4:01 pm
Operating System: Please select

Re: AUP File format information

Post by squarefoot » Sat Oct 03, 2009 9:30 pm

I browsed some more, and I got this page on the Audacity wiki

http://manual.audacityteam.org/index.ph ... =Scripting

If anyone can shed some light on that, I would be grateful. Maybe that may do the trick for me. I'll post my discoveries here.

Thanks for all inputs

Post Reply