Import WAV files into Audacity via programming

Hey Koz,

Yep, thanks for replying. I was able to update the <waveclip offset=“0.0000000”… to a higher (or lower) value and it moves the clip in the appropriate direction. I would be able to position things in the proper place once I figure it out.

I tried setting the preference to use the wav files directly instead of saving the .au file, but it looks like it creates an “alias” file in the same place which is still binary so, kind of the same problem; maybe wordse.

I found this link: https://forum.audacityteam.org/t/au-files-format-specification/30195/1 from someone else trying to reverse engineer the .au files but takes a last stab at the format at the end of the thread. Not sure how accurate it is, but I would need to be able to format it using a different tool.

I cloned the source to my server and did a search for “AudacityBlockFile” since that’s at the beginning of all the .au files. I found it’s in BlockFile.cpp where I found this in the comments:

A BlockFile represents a chunk of audio data.  These chunks are
assembled into sequences by the class Sequence.  These classes
are at the heart of how Audacity stores audio data.

So I’ll try to find out how it breaks into it’s chunks (which I think I already found) and how it creates and saves the file. So, cpp is not one of my languages so if anyone knows it, or anyone knows how I can create the same pcm file, I’m all ears.

Thanks,