Is there an application that can search for stereo 2 channel .WAV files that are actually mono (left and right channels are the same) and convert them to a single channel mono .WAV file? I'm looking to save HD space but don't have the time to do it manually.
Maybe even with a threshold since the noise floor can be stereo.
Batch finding/converting stereo audio files that are actually mono.
-
- KVRian
- 811 posts since 2 Aug, 2013
- KVRAF
- 1583 posts since 26 Aug, 2019
I'd look at SoX or ffmpeg. A command line tool would facilitate automating such a task inside a script.
https://superuser.com/questions/1635775 ... -in-stereo
https://trac.ffmpeg.org/wiki/AudioChannelManipulation
Look at the examples for SoX in that superuser link. With some google-fu might even be able to find a script that does exactly what you want.
Seems like you need the following steps:
https://superuser.com/questions/1635775 ... -in-stereo
https://trac.ffmpeg.org/wiki/AudioChannelManipulation
Look at the examples for SoX in that superuser link. With some google-fu might even be able to find a script that does exactly what you want.
Seems like you need the following steps:
- recursively scan a directory tree of audio files
- for each audio file found:
- compare L and R to see if they match
- if they do match, convert to single-channel mono
- move to the next found file
-
- KVRist
- 187 posts since 20 Jul, 2004
If you know some Python you could use the os.walk() function to find the files (IIRC that function does all the recursion for you), then scipy.io.wavfile.read() to read the files. After comparing L and R and checking if they’re identical you could - where needed - write new mono files with scipy.io.wavfile.write()
The os module also contains some stuff that could be used to delete the old stereo files or move them somewhere for later manual deletion (I get a bit nervous when deleting stuff with scripts, at least before I’ve been using the script enough that I feel certain it works as intended).
(What i’ve described here is pretty much the step by step solution suggested above by kidslow btw, just adding some specific Python modules which could be useful)
The os module also contains some stuff that could be used to delete the old stereo files or move them somewhere for later manual deletion (I get a bit nervous when deleting stuff with scripts, at least before I’ve been using the script enough that I feel certain it works as intended).
(What i’ve described here is pretty much the step by step solution suggested above by kidslow btw, just adding some specific Python modules which could be useful)
- Beware the Quoth
- 35449 posts since 4 Sep, 2001 from R'lyeh Oceanic Amusement Park and Funfair
I would imagine it can also be done by extracting L and R channels into separate files in one pass, then deleting files if there's a duplicate MD5 checksum in the second pass.kidslow wrote: Sun Oct 01, 2023 2:55 am Seems like you need the following steps:
- recursively scan a directory tree of audio files
- for each audio file found:
- compare L and R to see if they match
- if they do match, convert to single-channel mono
- move to the next found file
An idiot on Set Theory:
"In some cases there is an object called red that contains everything that is red. In much the same way a pot is a plate."
"In some cases there is an object called red that contains everything that is red. In much the same way a pot is a plate."
