Сhanging project rate.

Dear experts! Is it possible to improve the editor so that changing project rate could be included to the chain (macros)?

Anything is possible, but what is your specific use case? What are you trying to do?

My favorite music is 60-70-th, among the tracks when downloading there are records with low rate, for example 22500 Hz. Just in case, I raise it to 44000 or 48000 Hz, now there are no hot keys or chains for this, I have to translate the value in the lower left corner every time.

I don’t understand what that means.


I’ve meant the songs of 1960-70s. And on the second question: I sometimes send music to sites, and so, on some, files with a low, up to 44000 Hz, are not accepted.

It is not yet possible to change the project rate with a macro command, so I’ll put the suggestion to the developer that has been working on the new macro commands.

Regarding your specific use case, there are a number of ways that the problem could be solved, some of which are possible now, and some of which are feature requests:

  1. Specify the sample rate in the export command.
    This is not currently possible using Audacity’s built-in exporters (though it logged as a frequently requested feature), but it IS possible using the “external program” export option https://manual.audacityteam.org/man/exporting_to_an_external_program.html
    For example, if you have SoX installed (http://sox.sourceforge.net/Main/HomePage) and you want a WAV file with a sample rate of 44100 Hz, then you can use the command:
sox -t wav - -r 44100 "%f"
  1. Ensure that the file is not imported into an empty project. This won’t work when batch processing, because the batch process effectively creates a new project on import, but is easily done in other cases. If the project is not empty, then Audacity retains its current project rate.

  2. Feature request: Ability to specify the sample rate as an export setting.

  3. Feature request: Preference setting to NOT change the project rate when importing.

  4. Batch process your files with a suitable transcoding application so that they are all in an appropriate format before using Audacity.

  5. Use Python (or any language that supports “named pipes”) to drive Audacity via mod-script-pipe. Mod-script-pipe is not yet available as a ready-built module, but it is on its way. More info: https://manual.audacityteam.org/man/scripting.html

“External program” export - I don’t quite understand. A window opens with the lame command and something further. And how can I choose a format and bit-rate now? And other options that were available in the usual mp3 export?

These options? How can I choose? Preset, variable, stereо, joint stereo…

The “external program” export option allows you to specify any command line encoder that you have installed on your computer.
Examples are included for “lame” and “ffmpeg” command line encoders.
In my previous post I gave an example using SoX command line encoder.

Detailed instructions for the “external program” export option are here: https://manual.audacityteam.org/man/exporting_to_an_external_program.html

SoX may be downloaded here: http://sox.sourceforge.net/
The full SoX manual is here: http://sox.sourceforge.net/Docs/Documentation

Well, is it possible to upgrade a command for sox

sox -t wav - -r 44100 "%f"

so that the export is in mp3 format, 48000 Hz and bit rate of 320 kbit/s? That is, I guess that wav should be replaced by mp3, 44100 - to 48000, and how to set the bit rate of 320 kbit/s?

sox -t mp3 - -r 48000 "%f"

By the way, the program has not been updated for a long time.

The sample rate can easily be changed to 48000 Hz:

sox -t wav - -r 48000 "%f"

I’m unable to test MP3 export with SoX as the version of SoX installed on my machine is built without MP3 support. If you have a build of SoX that has MP3 support, then it will probably work by just adding “.mp3” to the export file name (this works for me with OGG format).

Regarding other SoX settings, refer to the docs: http://sox.sourceforge.net/sox.html

You’ll be pleased to know that subject to testing, this should be available in the next release (scheduled for January).

Thank you!

In the new alpha version (dated 22.10.18) the Set Project option works quite normally. Thank you!

Thanks for confirming.

In addition, there is another reason. It is inconvenient to work with 22500 or 32000 Hz files - either one or the other effect does not work, most often a band-stop filter. Thank you!