Help - Search - Members - Calendar
Full Version: Commandline question
Hydrogenaudio Forums > Lossy Audio Compression > Ogg Vorbis > Ogg Vorbis - General
humanoidboogie
Is there a way to encode from WAV/FLAC/etc. to OGG using only the left or right channel of the stereo signal? I might be wrong, but I believe the mono command collapses both channels into mono... The reason I'm asking is because I have several CD's sourced from mono LP's that were transferred in stereo. I might be lazy, but it's a bit annoying having to edit the files in Adobe Audition or similar before encoding.
smok3
you could use command line sox and write a batch using commands like;

sox "input.wav" -c 1 "input.a2.wav" avg -r

or

sox "input.wav" -c 1 "input.a1.wav" avg -l

---------------

http://sox.sourceforge.net/

p.s. i have a script writen that splits input stereo wav to two files, but it is writen for total commander and it is pretty ugly..., let me know and i will post it.
AndyH-ha
For your own enlightenment, you might like to try a little exercise in audition.

Create a new stereo file. You could choose mono if you don't believe you have enough understanding of what will happen and thus don't trust what you observe when starting with stereo.

Select one channel (of this currently zero length file).

Generate a tone of 3 seconds, 10 seconds, 59 minutes, whatever makes you feel secure. You could also generate any flavor of noise, or paste in something from elsewhere.

Select and copy the filled channel. Select the empty channel. Paste the contents into it. If you started with mono in the first step, you must now first create an empty stereo file and paste the clipboard contents into both channels.

Now you should be certain that you have a true dual mono file. Run Analyze/Statistics on it and copy the results to notepad or some other convenient holder.

Select Transform/Amplify/Channel Mixer. Select the LR to Mid-Side preset. Run it. This will combine the two channels into a mono result in the left channel and put the differences into the right channel.

Observe that the right channel it totally blank, digital zero. Run Analyze/Statistics. Observe that all the left channels numbers are identical to your original file's results.

Click on undo to restore the dual mono condition.

Select Edit/Convert Sample Type. Select mono; make sure the other parameters match your file so no changes are made to sample rate and bit depth.

Click on OK to convert to mono. Run Analyze/Statistics. Observe that all the numbers are identical to your original file's results.

Conclusion. There is nothing to be gained by first editing in Audition -- unless the LAME process is defective. The end result will be the same as if you started with a mono file, without going through extra steps.
humanoidboogie
Thanks for the help, smok3.

And, er, thanks AndyH-ha. Maybe we're misunderstanding each other, but I didn't really understand the "exercise"... Would you care to elaborate on that?

QUOTE(smok3 @ Jun 11 2007, 21:05) *

you could use command line sox and write a batch using commands like;

sox "input.wav" -c 1 "input.a2.wav" avg -r

or

sox "input.wav" -c 1 "input.a1.wav" avg -l


By the way, does this mean I still have to go through two steps during encoding (convert the original WAV file, save it, then encode to OGG)? I'm not familiar with SoX and generally just use oggdropXP/aoTuV b5... unsure.gif
smok3
QUOTE
does this mean I still have to go through two steps during encoding (convert the original WAV file, save it, then encode to OGG)?
yes, unless there is a way to pipe the sox output directly to oggenc.
woody_woodward
QUOTE(humanoidboogie @ Jun 11 2007, 12:04) *

Is there a way to encode from WAV/FLAC/etc. to OGG using only the left or right channel of the stereo signal? I might be wrong, but I believe the mono command collapses both channels into mono... The reason I'm asking is because I have several CD's sourced from mono LP's that were transferred in stereo. I might be lazy, but it's a bit annoying having to edit the files in Adobe Audition or similar before encoding.

I'm not understanding. If the original source was mono, you should be able to use left, right, or combined. No difference. Just tell OGG to create a mono file.

Maybe I missed something.... I'm not as astute as I once was.
smok3
p.s. and yes AndyH-ha & woody_woodward are right.
Synthetic Soul
CODE
sox "test.wav" -t raw -s -w -c 1 - avg -l | oggenc2 -r -C 1 - -o "test1.ogg"

CODE
oggenc2 --downmix "test.wav" -o "test2.ogg"

CODE
Comparing:
"C:\Documents and Settings\Neil\Desktop\test1.ogg"
"C:\Documents and Settings\Neil\Desktop\test2.ogg"
No differences in decoded data found.

humanoidboogie
Maybe I was a bit vague as to WHY I only wanted to use either the left or right channel, as opposed to combine both.

I always transfer mono LP's using my regular stereo set-up. That way I can pick the best-sounding channel (left or right) later on during editing/downsampling/etc.. As you might know, the record stylus will wear out the grooves a little by each play. This is especially true with second hand vinyl, as the previous owner might have played the records with an incorrect tone arm alignment or perhaps even a bad stylus. Er, well... I'm straying from the point here, but... Anyway, once again, thanks for your help!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.