Automating file conversion

Audio software developers forum.
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
Post Reply
mellman99
Posts: 2
Joined: Thu Jul 30, 2020 1:31 pm
Operating System: Windows 10

Automating file conversion

Post by mellman99 » Thu Jul 30, 2020 1:43 pm

Good morning!

First let me say I'm not an audacity user, in the slightest... I can use it to manually convert a file to the proper format, but I'd like to automate this process somewhat.

What I am looking to do is have a script (Python, Powershell) run on a schedule and look in a folder for mp3 files. If it sees a files, I want to feed this file in to Audacity to convert it to a different specific format (WAV, u-law, 8bit, mono, 8000khz) so that I can push this over into my phone system's IVR prompts. I can do the rest, but interfacing powershell or python to Audacity is where i'm lost - can anyone point me in the right direction or provide some examples of how i could perform this kind of task?

Cheers!
Matt

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

Re: Automating file conversion

Post by steve » Thu Jul 30, 2020 2:25 pm

mellman99 wrote:
Thu Jul 30, 2020 1:43 pm
What I am looking to do is have a script (Python, Powershell) run on a schedule and look in a folder for mp3 files. If it sees a files, I want to feed this file in to Audacity to convert it to a different specific format (WAV, u-law, 8bit, mono, 8000khz)
It would be quicker and easier to use a command line decoder such as LAME or SoX.

Alternatively you may be able to use a native Python decoder library such as "pymad".
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

mellman99
Posts: 2
Joined: Thu Jul 30, 2020 1:31 pm
Operating System: Windows 10

Re: Automating file conversion

Post by mellman99 » Mon Aug 03, 2020 2:00 am

Thank you! I ended up getting sox to do exactly what I needed pretty easily. I appreciate the tip!

Post Reply