Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I know how to remove the vocals by using SoX. The command is

sox source.wav mono.wav oops

which means to mix stereo to twin-mono where each mono channel contains the difference between the left and right stereo channels. It's equivalent to

sox source.wav mono.wav remix 1,2i 1,2i

But how can I extract the vocals?

I've tried to remix the source file with the mono file

sox -M source.wav mono.wav vocal.wav remix 1,2i 1,2i

but it does not work.

If it's not possible with SoX, any other command line solutions are appreciated.

share|improve this question
    
If you put in the mono file as the right channel of mono_plus_left.wav and the original left channel as the left channel, then wouldn't the oops command output the vocals plus half of the instruments? ...and then Step 2 would be to put the mono file as the left channel of mono_plus_right.wav and the original right channel as the right channel, then run the oops command on that and it should output just the vocals. (Note: I don't want to put this as an answer unless it works, since I don't have SoX to try it out right now.) –  A.M. Aug 3 '13 at 22:53
    
Unfortunately your suggestion does not work –  whatUwant Aug 3 '13 at 23:21
add comment

1 Answer

You cannot fully extract the vocals of a sound file without processing heavy manipulations.
The issue is that, mathematically, the software does not have enough information to isolate it.

Let me explain, in a simple way you can decompose your stereo file as three data. The sound that is pure left (L), the sound that is pure right (R) and the sound that is pure middle (M).

If we name the two stereo channels X and Y, then we simply have :

X = R + M/2
Y = L + M/2

And what we know are X and Y, the three others are the unknown we want to isolate.

The idea of your method to remove vocals is that vocals are almost always in the Middle part. So you can just compute

X - Y = R - L

As the Right and Left data are totally different, there are no interferences and it does not sound bad. However, it also removes all the Middle instruments, and if vocals are not exactly centred, it does not work perfectly.

What you want, is to isolate M, and given the data, it's mathematically not possible by simple combination of the 2 channels : it's a 2-equation linear system with 3 unknowns, there is not enough data to solve it, and extracting M implies to solve it.

You may try to extract vocals by more heavy means but it'll cost you a lot of time and the result will hardly be good. It very tough separating vocals and instruments, as they are mainly in the same frequency range.

share|improve this answer
    
Thanks for the explanation. I've found some plug-ins for audio softwares that can isolate the vocals. I don't know how they do it, but the extracted audio is acceptable. I actually don't need very clean vocals from the music. All I need is to identify the time span when human voice starts and ends. –  whatUwant Aug 4 '13 at 17:25
    
@whatUwant In a general way, that is really not evident, because from the point of view of a computer, voices are not really different than any other instrument. Anyway, I would look for tools designed for frequency analysis. –  Levans Aug 4 '13 at 17:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.