.aup file reference and .wav instead of .au

Audio software developers forum.

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

.aup file reference and .wav instead of .au

Permanent link to this post Posted by qwertquadrat » Wed Dec 28, 2016 8:47 pm

Hello everyone,

my long-term goal is developing an Audacity Project (.aup) Export and Import add-on for Blender. The point is: Blender has a not so well-known but very useful non-linear non-destructive video editor with a few video effects built in. The only important thing I miss in everyday use are audio filters such as simple noise reduction. So my add-on shall face that by making it possible to just create a video in Blender and export the audio layers to an Audacity Project in which one can then tune the sound. Blender add-ons are btw. written in Python.

All in all my main questions are for now:
* Is there anywhere a file reference for .aup files? I did not find any, but hope persists.

* Is there a way Audacity recognizes projects with different sound file types than .au files? Such as .wav files?
I am not that familiar with how sound files work and only found a python script that converts .au files to .wav files (audacity.py by davidavdav on Github). For my add-on I also need the functionality the other way or the possibility to bypass the problem by using .wav files instead of .au files.

Thanks very much in advance!
qwertquadrat
qwertquadrat
 
Posts: 14
Joined: Wed Dec 28, 2016 8:21 pm
Operating System: Windows 10

Re: .aup file reference and .wav instead of .au

Permanent link to this post Posted by kozikowski » Thu Dec 29, 2016 12:36 am

Certainly. Audacity can Import and Export (not save) WAV (Microsoft, 16-bit), Stereo or Mono.

Audacity doesn't save sound files. You're probably wondering what all those little AU files are. Those are part of an Audacity Project. They're not all sound files....

http://manual.audacityteam.org/man/auda ... jects.html

Koz
kozikowski
Forum Staff
 
Posts: 37707
Joined: Thu Aug 02, 2007 5:57 pm
Location: Los Angeles
Operating System: OS X 10.9 Mavericks

Re: .aup file reference and .wav instead of .au

Permanent link to this post Posted by qwertquadrat » Thu Dec 29, 2016 1:47 am

Hm, yeah, that's sadly what I already knew...

TL;DR:
The interesting part of this concept is not about importing WAV files into Audacity but about packing many (many!) WAV files so that Audacity knows on which layer with which offset and which volume envelope to put them.

Blender can export WAV files and importing them into Audacity as you suggest is what I've done so far. Problem is that since projects in Blender get bigger, sound becomes multi-layered with different offsets. Exporting every single layer from the Blender VSE to a WAV file and importing each into Audacity is okay for let's say 5 sound strips - but since videos get more complex, I have to export from Blender and import to Audacity many more.

For a better understanding on what the other program I want to write that add-on for does: In the Blender VSE (yes, that IS part of the open source 3D animation software Blender and yes, I use its VSE (Visual Sequence Editor) for non-animated - real-life - videos) I already have multi-layered strips exactly as you know them from Audacity or every other multi-layer video or audio editing software. Means: It just seems great to create a script that takes all audio layers and volume envelopes from one blender project and put them into one file (or project) Audacity can read. Since uncompressed Audacity Projects (.aup) seem to be the only multi-layered file (/project) type with layer-based volume envelopes Audacity can read, I obviously have to stick with this project format.

qwertquadrat
qwertquadrat
 
Posts: 14
Joined: Wed Dec 28, 2016 8:21 pm
Operating System: Windows 10

Re: .aup file reference and .wav instead of .au

Permanent link to this post Posted by Gale Andrews » Fri Dec 30, 2016 8:49 pm

qwertquadrat wrote:my long-term goal is developing an Audacity Project (.aup) Export and Import add-on for Blender. The point is: Blender has a not so well-known but very useful non-linear non-destructive video editor with a few video effects built in. The only important thing I miss in everyday use are audio filters such as simple noise reduction. So my add-on shall face that by making it possible to just create a video in Blender and export the audio layers to an Audacity Project in which one can then tune the sound. Blender add-ons are btw. written in Python.

Is it possible to set Audacity as external audio editor for Blender?

qwertquadrat wrote:Is there anywhere a file reference for .aup files? I did not find any, but hope persists.

There is a DTD file https://github.com/audacity/audacity/blob/master/src/xml/audacityproject.dtd.

qwertquadrat wrote:* Is there a way Audacity recognizes projects with different sound file types than .au files? Such as .wav files?

No. Audacity does not open files directly.

Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 26093
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: .aup file reference and .wav instead of .au

Permanent link to this post Posted by qwertquadrat » Sat Dec 31, 2016 2:12 am

Gale Andrews wrote:Is it possible to set Audacity as external audio editor for Blender?

Not out of the box - but of course one could script an add-on which does that. That is kinda what I already did in my previous projects: First to take every sound strip, edit it in Audacity and then import it in Blender. So one had to edit every sound strip individually - and hope that everything matches later on. That is okay for small projects, but not for large ones, where one want to edit one sound strip dependent on how the others sound.

Gale Andrews wrote:There is a DTD file https://github.com/audacity/audacity/bl ... roject.dtd.

That is good! Although I miss the "import"-tag in this DTD file that is used in compressed audacity project files - I guess that is the interesting part for my project, because in compressed projects, the import tag can contain the path to files with file types Blender could export out of the box.

Gale Andrews wrote:No. Audacity does not open files directly.

Have feared that. But as seen in compressed audacity project files, at least .ogg files (and as I tried out - also .wav-files) can be recognized on project opening, when linked via this "import"-tag. For the "Export from Blender"-part of my add-on, using those "import"-tags could be sufficient. (The "Import to Blender"-part can probably be done using the script by davidavdav mentioned above.)

So all in all, everything I need to know with the "import"-tags in mind is: How does one specify the volume envelope of the audio linked via "import"-tags in the Audacity project file? (Please say that it is possible at all?)

qwertquadrat
qwertquadrat
 
Posts: 14
Joined: Wed Dec 28, 2016 8:21 pm
Operating System: Windows 10

Re: .aup file reference and .wav instead of .au

Permanent link to this post Posted by steve » Sat Dec 31, 2016 12:13 pm

qwertquadrat wrote:That is good! Although I miss the "import"-tag in this DTD file that is used in compressed audacity project files

The audacityproject.dtd file is badly out of date. It's not been updated in at least 6 years, quite possibly longer, so some features of the Audacity Project XML format are undocumented.

One such feature is the import element.
I'm not an expert in XML, but it should be something like:
Code: Select all
<!ELEMENT import EMPTY>
<!ATTLIST import filename CDATA #REQUIRED>
<!ATTLIST import offset CDATA "0">
<!ATTLIST import mute CDATA "0">
<!ATTLIST import solo CDATA "0">
<!ATTLIST import height CDATA "150">
<!ATTLIST import minimized CDATA "0">
<!ATTLIST import gain CDATA "1">
<!ATTLIST import pan CDATA "0">


or
Code: Select all
<!ELEMENT import EMPTY>
<!ATTLIST import filename CDATA #REQUIRED>
<!ATTLIST import offset CDATA #IMPLIED>
<!ATTLIST import mute CDATA #IMPLIED>
<!ATTLIST import solo CDATA #IMPLIED>
<!ATTLIST import height CDATA #IMPLIED>
<!ATTLIST import minimized CDATA #IMPLIED>
<!ATTLIST import gain CDATA #IMPLIED>
<!ATTLIST import pan CDATA #IMPLIED>


(The latter seems to be more "correct" in terms of the current implementation, but of course the implementation could change in future versions of Audacity)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 44458
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: .aup file reference and .wav instead of .au

Permanent link to this post Posted by steve » Sat Dec 31, 2016 1:34 pm

qwertquadrat wrote:But as seen in compressed audacity project files, at least .ogg files (and as I tried out - also .wav-files) can be recognized on project opening, when linked via this "import"-tag

Yes they are "recognised", but they are still "imported" rather than "opened".
If a project contains an import tag, that tells Audacity to import the file filename (declared by the "filename" attribute). Audacity then decodes the (usually "Ogg") file, and copies its audio data as "blockfiles" (".AU" file extension).

qwertquadrat wrote:How does one specify the volume envelope of the audio linked via "import"-tags in the Audacity project file?

Short answer, you don't.
As described in my previous post, the import element has no child elements. It is just imported as is. (No support for adding envelope or any other elements).
When saving a compressed copy of a project, any envelopes are applied to the tracks before exporting the track OGG files.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 44458
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: .aup file reference and .wav instead of .au

Permanent link to this post Posted by qwertquadrat » Sun Jan 01, 2017 7:49 pm

steve wrote:Yes they are "recognised", but they are still "imported" rather than "opened".

Yes, but that's fully okay for my purposes.

steve wrote:Short answer, you don't.

Ough, that is sad. So I either can't export the volume envelope from Blender or I can't use the "import"-tags which means I would have to somehow add the possibility via Python to export to .au files in Blender. I actually hoped for such a workaround as the following (not working) try.
Code: Select all
   <import filename="testproject2.wav"/>
   <wavetrack name="testproject2">
      <waveclip>
         <envelope numpoints="3">
            <controlpoint t="0.011609977324" val="0.750000000000"/>
            <controlpoint t="0.290249433107" val="1.000000000000"/>
            <controlpoint t="0.661768707483" val="0.708333313465"/>
         </envelope>
      </waveclip>
   </wavetrack>


All in all, I think, unless it was planned to add support for exporting compressed project files with preserved envelopes, the best solution is to export a compressed Audacity project file from Blender, open that in Audacity so that it turns the imports to .au files and then re-open that file in Blender via my add-on and add the envelopes to the Audacity project. That is not very user friendly - but the best I can imagine right now; Unless someone writes a standalone .wav to .au file converter or adds command line control to Audacity (which would be really great btw.!).

Thank you all very much for your help for now! If anyone has a great idea on how Audacity can be integrated better in the Blender VSE, I would be happy to read about it!
qwertquadrat
 
Posts: 14
Joined: Wed Dec 28, 2016 8:21 pm
Operating System: Windows 10

Re: .aup file reference and .wav instead of .au

Permanent link to this post Posted by steve » Mon Jan 02, 2017 3:24 pm

How does Blender handle audio?
Can you not just use Audacity in the normal way to edit and export the audio?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 44458
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: .aup file reference and .wav instead of .au

Permanent link to this post Posted by qwertquadrat » Mon Jan 02, 2017 4:27 pm

steve wrote:Can you not just use Audacity in the normal way to edit and export the audio?

Sorry, I'm not sure if I understand what you want to suggest. Is the following answer given above not also applicable for your question?
qwertquadrat wrote:That is kinda what I already did in my previous projects: First to take every sound strip, edit it in Audacity and then import it in Blender. So one had to edit every sound strip individually - and hope that everything matches later on. That is okay for small projects, but not for large ones, where one want to edit one sound strip dependent on how the others sound.

Or is your suggestion to mixdown the audio from Blender and import that in Audacity? Then you can't edit every sound layer independently - Which means that you can't tune for example only the music or only the sound effects or only the voice of an actor or the narrator etc.. And if you are looking for a low-pass filter for the music for a scene, where the camera dives into water, you do not necessairly want to low-pass filter also the narrators voice.

steve wrote:How does Blender handle audio?

Via the Python API you have access to "sound sequences" that are quite similar to the sequences from Audacity. Their graphical representation is similar to that in any other non-linear editor, like Audacity also is. Internally FFmpeg is used to handle audio (as far as I know). Via the API you have access to the class described here:
https://www.blender.org/api/blender_python_api_2_78a_release/bpy.types.SoundSequence.html
qwertquadrat
 
Posts: 14
Joined: Wed Dec 28, 2016 8:21 pm
Operating System: Windows 10

Next

Return to General Audio Programming



Who is online

Users browsing this forum: No registered users and 2 guests