First of, I want to say thank you for all the effort you have put into creating Audacity. I learned a great deal, in a very short amount of time with the help of all your efforts.
This year, I was working on a DSP project that required me to write a program in Python to plot the spectrum of recordings obtained using Audacity.
I basically used Audacity to record sound with a normal microphone → laptop setup. Then my Python program would read it, and use existing libraries (such as http://greenteapress.com/wp/think-dsp/) to generate a spectrum and look at different frequency bands.
In the end, everything worked out, but I could never get the same spectrum plot as Audacity… I am unsure of whether my analysis was faulty, or my windowing, or if Audacity does some smoothing that I could not get behind. I was wondering if it is possible to pipe the spectrum data from Audacity to Python?
If not, can someone point me in a direction where I can figure out what I did wrong?
I am unsure of what I should provide here to be helped… but I will be more than willing to supply any needed info.
Audacity does not have that feature built in, but some options are:
Use AutoKey, Sikuli or similar to automate Audacity via its GUI.
Build Audacity from the sourcecode and enable “mod-script-pipe” (Some of the documentation may be out of date as I don’t think anyone has worked on this “experimental” feature for quite a while: http://manual.audacityteam.org/man/scripting.html)
I will explore the “mod-script-pipe” and AutoKey avenues and report back.
Regarding the FFT in Python… this is what I did do, but my FFT analyses does not output the same graphs (guessing its either my smoothing or windowing methods that are faulty) as Audacity and subsequently I do not get the correct peak values. That is why I thought that maybe I can somehow access (or pipe) the data that Audacity generates
Are you comparing the (text) data, or just the (graphic) graph?
The text data from Audacity is “scientifically” accurate, but how the graph is drawn is in part a matter of interpretation. There are many ways to interpolate / extrapolate, and the methods used by Audacity are just one choice. Different methods can look significantly different.
I’ve been trying to remember the name of the automation tool I used a while back (to automate a job in Audacity) - just remembered
Ubuntu and Debian both have it in their repositories.