Bulk macro and setting sample rate

I have used macros for bulk processing once before, therefore, a novice at it.
I don’t understand how to specify the sample rate for mp3 file processing. I am changing from stereo to mono (i found that command) and use sample rate of 16000, simply to reduce files sizes. I know that sound quality will be lower, but these are spoken word podcasts, so I don’t care about that.

I have seen references to how sample rate will be whatever was last used, but when I export a project with 16000, then close and open another, it resets to 44100. I have also seen references to setting the sample rate in ‘project rate’. this doesn’t seem to make any difference in what appears as default sample rate.

through all this I am using Quality: Medium, again, to reduce file size.

I have also seen reference to using constant as ‘bit rate mode’. that seemed to triple the file size.

In short, I don’t understand how to insure that the bulk conversion will use 16000 sample rate. I don’t see a setting for sample rate in the macro settings.

or, are there other settings that will reduce the file size by ap. 30%, as moving from sample rate 44100 to 16000 did, so that I don’t have to change the sample rate.

I hope my request is clear. Thanks for any explanation or suggestions.

The file size is directly related to the bitrate (kbps). (That’s assuming there is no embedded album artwork which adds to file size without affecting the bitrate).

You can check the current bitrate with MediaInfoOnline (or you can calculate it).

Then when you export, select the MP3 Bit Rate Mode as Constant or Average. If you type-in a bitrate half of the original, the file will be half the size, etc.

…With Variable bitrate, you choose the “quality” and the program decides what bitrate to use. Spoken word is “easier” to compress than music so for the same VBR quality setting you’ll get a smaller file (lower bitrate) with spoken word.

+++++++++++++
kbps is kilobits per second and there are 8-bits in a byte, so divide by 8 to get file size in kilobytes per second.

thanks. since I can’t make enough sense of bitrates, quality, variable/constant, etc, to determine which might be best cmbination, I wound up trying about 15 different combinations of bit rates, variable, quality, to find one that sounds good enough and smallest size.

original question remains: using macros, how do I ensure that the settings I want are being used in the macro? there doesn’t seem to be a macro settings for sample size, variable rate, and quality. do I have to run a dummy export audio using those settings and then run the macro and hope that those settings are still being used?

That should work.

thanks.
are you confirming that there are no macro commands for sample size, rate, and quality? that is necessary to remember to go through the ‘band aid’ of running a dummy export?

Yes, it’s a longstanding enhancement request.

turns out that these instructions don’t work. a dummy export is run with the desired sample size, rate and quality. macro won’t run until dummy project is closed, so I close it and ran the macro on a sample file and wound up with a file that is larger than the original… turns out audacity resets the sample size to 44100. I had set in the dummy export to 16000, variable rate, quality 150-.

I tried setting the audio>audio setting > project and default sample size settings to 16000. doesn’t change anything. the project or default sample size still remains 44100.

looks like that without a macro command to set the sample size, a macro won’t run with any other than 44100. for my purpose this is worse than useless.

I have no idea what the point is with the audio settings.

The dummy export does set the MP3 preferences, but in recent versions of Audacity a sample rate setting has been added to the Export dialog, and it turns out that this is NOT carried over to the next export.

When the sample rate is not manually set on export, the current sample rate is used.

The current sample rate depends on both the “default sample rate” that is set in Preferences, and the sample rate of the first imported file. When a file is imported into a new project, if the file’s sample rate is higher than the default sample rate, the file’s sample rate wins, and the sample rate for the “current project” is increased from the default value to match the file.

To force the project rate back down to specified low sample rate, you can add a “Set Project” command to the macro, with settings like this, anywhere before the export command:

set_project

If you are only converting the format of the files, it would be easier, quicker, and more reliable to use a format converter rather than Audacity. On Windows, foobar2000 works very well for batch format conversions.

thanks for suggestion. I’ll try foobar.
I am curious about why you indicate that foobar “more reliable”?

  • For some unknown reason, Audacity macros frequently fail if applied to more than a few hundred files at a time.
  • Format conversion in Audacity is quirky (as you have discovered), and it is very easy to end up with a slightly different format (such as the wrong sample rate).
  • You have to remember to do a dummy run.

yep, all reasons I have experienced.

I have found the macro function to crash doing more than around 10 at a time.

foobar does the job. converts mp3 files to a smaller size, and seems like it does better maintaining sound quality then audacity did when shrinking file size. and no crashes.

so, I load mp3 into audacity, edit a bit and then export file with it’s default sample rate (44100). then load file into foobar and convert. I’m not seeing an edit function in Foobar.

Thanks for explanations, and suggestion to use Foobar.

The sound quality when converting to MP3 should be identical for both programs as they both use the same encoder (LAME), though I would expect Foobar2000 to be quicker as it reads directly from the source file, whereas Audacity works from a disk copy of the audio data.
Foobar2000 also supports ReplayGain, which may affect the playback volume if enabled and played back on an app or device that supports ReplayGain.

Foobar2000 is an audio player and converter. It does not do editing. When I was on Windows, I used Foobar2000 as my default audio player, as it is relatively lightweight, and an excellent player for a vast range of audio formats.