Hi folks,
next thingie is here.
- output is always 24bit WAV rendered to active project directory
- resampled files are added as new takes to items
- headroom is introduced to avoid possible sample clipping at resampled output, level loss is compensated by increase of new take volume
- skips files, which are already at required rate, so if used for processing of all project items, only ones with different samplerate will be processed. Similarly if file is used several times at your project, it will be resampled only once.
- you can customize called command, file and take naming, default headroom on top of script
- requires working SoX installation
- requires latest beta of SWS extensions (due to Breeder's nice BR_SetTakeSourceFromFile)
- executable needs to be either in system path or you'll have to modify sox_path variable with full path to your SoX installation
remarks:
- tested with Python 2.7 on Win7, but theoretically it should work also on OS X with different Python versions (if not, let me know).
- it hangs UI of Reaper during longer processing. It could be possibly reworked for use of beyond. python package to avoid this, but it will complicate standard installation and setup
- processing can't be easily aborted once script is started, that is also why i did popup at start without straight conversion of selected items to project rate
- it can be possibly modified to threaded version with queues and parallel processing via SoX workers, but it is slightly related to previous point and looks like unnecessary fuss to me.. ;-)
I've done it mainly as helper for working with 48k projects for video, where are often placed tracks from music or FX libraries with CD rates. Another side effect is also consolidation linked material from elsewhere to project folder at common rate.
Maybe, you'll find it also useful.
Download link:
https://stash.reaper.fm/21644/resample_items_sox.py
and example:
UPDATE: Finally, i had chance to try it on OS X, there is need to call SoX executable within its shell when not using list of arguments. It works that way also on Windows, but it hides cmd.exe windows, where is progress of SoX processing. Forget to mention first and added special config variable "subprocess_shell" for it.
Michal