Macro/Scripting To Automate Metadata Editing

Hey all,

I am using the Audacity Scripting (mod-script-pipe) alongside Python to aid in automating the improvement of my file-based audio collection; I want to inject artist/album/song metadata into the INFO chunk and output WAV-to-WAV.
I can open a new project, import an audio file, open the Edit Metadata window, but now cannot figure out how to then automatically add text values to the tag keys. I cannot find any info online to help.
Is this even possible currently? Any help would be appreciated!

Code example below:
do_command(“New:”)
do_command(“Import2: Filename=/Some/Path/Desktop/test.wav”)
time.sleep(5)
do_command(“SelectAll:”)
time.sleep(2)
do_command(“EditMetaData:”)

I want to do something like:
do_command(“EditMetaData: Tag=Artist Text=‘Radioactive Man’”)
do_command(“EditMetaData: Tag=Genre Text=‘Electro’”)

Or something along those lines, hope you get my point.

I have tried all sorts but not getting anywhere.

Cheers,
NotFatTony

I don’t think there’s any way to directly edit metadata via Macro/Scripting.

One possible solution would be to manually create a “dummy” audio file that contains the required metadata. Import this file into an empty Audacity project to get the metadata into the project, then mute the track (you can optionally delete the track later).

Another possible workaround would be to export an audio file without metadata, then use Python to change the metadata (for example: https://eyed3.readthedocs.io/en/latest/)

Hi Steve,

Thanks for getting back to me :smiley:

Ah, that’s a shame.

I did look at the Python eyeD3 library the other day, but I believe it only works with MP3s/files that already have ID3 tags embedded.
When I point eyeD3 to one of my WAVs it doesnt recognise any audio - change the file in question to an MP3 and it works as expected.

I think FFmpeg can add metadata to WAV files.

I also tried FFmpeg but had no luck with adding metadata fields into the WAV INFO chunk - I will however check it out again as there are plenty of FFmpeg Python-wrapped libraries.

I am also exploring dBpoweramp - that has good metadata scripting using Windows Powershell… downside being I can only see documentation/examples using C++, C# or Visual Basic (I am a Python user). So a learning curve there.

I dont want to promote dBpoweramp on an Audacity forum (Audacity is king!!), but this looks like the best option so far in terms of scripting metadata injection/automation of RIFF tag creation.

I will update this thread with any progress as it may be helpful to someone in the future.

That’s OK, we know that dBpowerAmp is good, but not free and not available for Linux.

If you can’t find a Python wrapped FFmpeg that can do it, check to see if you can manually edit the metadata with FFmpeg from the command line. If you can, (which I think should be possible, though I’ve not tested), then you could perhaps run FFmpeg with the Python subprocess Module.

Great idea, thanks. Will check this out over next few days.