views:

491

answers:

3

I want to differentiate betwen the male n female voices in an audio file and seperate them.As an output I want the two voices seperated.Can u please help me out n can the coding be done in java or c++

+5  A: 

This is potentially a very complicated question, and it is similar to writing your own speech recognition (or identification) algorithm.

You would start by converting the audio into the frequency domain, which is done using a Fast Fourier Transform.

For each slice in time that you take an FFT, this will give you a list of frequencies and their amplitudes. You will somehow need to detect the fundamental tone by analysing the harmonics. The 2nd and 3rd harmonics will be clearest. It's very hard to figure out which harmonics they are, especially with the background noise and the natural difference between people's voices in terms of which harmonics are loudest. Then you can try to determine if the speaker is male or female by whatever you guessed the fundamental tone to be.

Keep in mind that during many parts of speech like sibilance ('s', 't', etc) there is no tone, just noise. It will need to be pretty intelligent.

Hope that sets you in the right general direction.

Note: if the two voices are simultaneous and you want to separate them cleanly, then this won't help you. I don't believe anyone alive has solved such a problem.

thomasrutter
+1. Just to back up the others, splitting simultaneous voices is a Hard Problem which even best-of-breed audio processors out there still can't solve with any great reliability.
bobince
A: 

What you are asking is one hell of a task. thomasrutter wrote some "pointers" how to do it - but, i guess the algorithm would have to be really really robust if you would wish to use it everywhere (in all sorts of music (with singing of course)). Maybe it would be better/easier to start with separating (spliting) a single instrument sample from the song.

+1  A: 

I would start by saying this is impossible. Speech recognition is really, really hard.

You're not clear in your question - are the voices overlapping? If so, splitting them up will be absurdly difficult.

If they are separate, your more likely bet is to have a large set of samples of male and female voices, and look for common characteristics (and a way to programmatically identify them). If the samples aren't recorded cleanly (if they have background noise), things get even more complicated.

You may get away with an average tone - male voices are generally deeper than female..

dbr
Yeah I like that idea, a statistical approach. You could have it learn the more it identifies correctly.
thomasrutter