I’ve written a macro that calls a mildly modified Nyquist plugin. The output from the plugin is an SNR value for a sound file.
I’d like to be able to batch calculate SNR values for number of sound files in a file folder, but see no way of appending the calculated SNR data to…well, anything really.
If batch calculated SNR values and corresponding file names were all appended to one and the same text window, that would be a solution. During batch processing each file generates a single window where an individual calculated SNR value is presented, and the window shuts before processing continues with the next file, so no.
Appending successive file names and corresponding calculated SNR values to a text file would do it, but Nyquist cannot write to text files from inside Audacity.
I thought appending calculated SNR values to labels in a label track would help, but the label track seems to be deleted at the end of batch calculation.
Appending the calculated weighted SNR value for each file to the name of the file and then saving the file would do it, but Nyquist isn’t allowed to modify file names.
How do I go about acheiving batch calculating SNR values for number of sound files? I presently handle this file by file, manually adding each calculated SNR value to the metadata of each file.
A presentation of the intended application for the macro and an associated Plugin can be found at https://xeno-canto.org/article/275. The macro and the associated Plugin can be downloaded from the same site.
Heureka! The problem was that Nyquist allows writing only to certain folders, so C:/ seems to be prohibited.
I tried this, and it generates a .txt file named like the sound file name. I tried calling this from a macro and the batch process a number of files, but it outputs pnly one .txt file name like the first (or last?) .wav file in the batch of files. If I only got that right, I could get batch processing started. Why doesn’t this (called from a macro) generate a number of .txt files, each named as the corresponding .wav file?
Because your script returns “NIL”, which Audacity sees as an error.
As you don’t actually want to return anything from Nyquist, add an empty string (two double quotes) to the end of the script, Audacity treats an empty string as a no-op (“no operation” = “do nothing”)