Resample-Macro

Questions, discussion and recipes for scripting and batch processing in Audacity.
See also the "Scripting" section of the Audacity manual.
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
mafg1953
Posts: 199
Joined: Tue Nov 05, 2019 3:49 pm
Operating System: Windows 10

Resample-Macro

Post by mafg1953 » Sun Mar 07, 2021 5:56 pm

Hi,

I can't seem to find where it might be possible to resample an audio file within a project using a macro. Is it possible to do this?

Thanks,

Mike

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

Re: Resample-Macro

Post by steve » Sun Mar 07, 2021 6:23 pm

mafg1953 wrote:
Sun Mar 07, 2021 5:56 pm
I can't seem to find where it might be possible to resample an audio file within a project using a macro. Is it possible to do this?
Do you mean that you want to change the sample rate of an audio file?
If so, then use the "SetProject:" command to change the "Project Rate" prior to exporting.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

mafg1953
Posts: 199
Joined: Tue Nov 05, 2019 3:49 pm
Operating System: Windows 10

Re: Resample-Macro

Post by mafg1953 » Sun Mar 07, 2021 6:35 pm

Thanks Steve,

I do already change that when I export a completed file.

My projects usually come to me at 32kHz and since I will be exporting them at 41kHz, I normally use the Tracks > Resample command as soon as I load the original file so that I work with them at 41kHz. Maybe I don't even need to do that but that is what the group suggested to do when I started editing for them. Is there any reason that I need to keep resampling when I get the original file or is it sufficient to work with the file at 32kHz and just do the resampling at the time of export?

Thanks,

Mike

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

Re: Resample-Macro

Post by steve » Sun Mar 07, 2021 6:55 pm

mafg1953 wrote:
Sun Mar 07, 2021 6:35 pm
Is there any reason that I need to keep resampling when I get the original file or is it sufficient to work with the file at 32kHz and just do the resampling at the time of export?
If you are working with multiple files in the same project (at the same time), then it can be more convenient to convert them to the same sample rate (some effects will complain if you try to apply to multiple tracks at the same time that have different sample rates.

If you are working with just one file at a time, then there's probably no advantage to resampling - just set the Project Rate and let Audacity resample on export.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply