Audacity Labels From Subtitles Files For Machine Learning

Audacity  is an easy-to-use audio editor and recorder for Windows, macOS, GNU/Linux and other operating systems. It can be used for many scientific applications. For example, to prepare audio dataset for text to speech or speech to text use cases in machine learning. You can load almost any audio format in Audacity. Using export multiple option combined with it’s label track feature, you can get a very powerful workflow to prepare speech datasets.

Adding more power to the workflow, I wrote a simple Python script that can take any subtitle file in the srt format and convert it so that Audacity can generate audio labels automatically for the subtitle’s audio.

So for example you can extract audio from your video. Run with it’s subtitle file path and import the newly generated file to Audacity project. AND BOOM!! You have your almost perfectly synced label track for your audio automatically created for you!

You can get the python script from here. Usage:

python --srt /path/to/
audacity label track generated from subtitle
audacity label track generated from subtitle

You should get your labels file at /path/to/ which can be imported as labels in a Audacity project.

Have something to say? Leave a comment!

%d bloggers like this: