I want to remove vocals from mp3 sound tracks(remove signer voice from the song file), I turned the song file into byte lists but don't know how to remove it's vocal with bytes. does any body knows the algorithm of removing with bytes ?(I would be happy if you explain with a sample code with any languages [I work with dart]). I read this article but the bytes haven't left and right :
1 Answers
Removing a voice isn't so simple. Usually, it's a combination of several tricks, like band-stop filters, spectrographic analysis (i.e. you'll need to use a FFT, Fast-Fourier Transform to switch to frequencies), and so on.
Simply "substracting" the two channels (i.e. phase cancellation) can't work if the original song wasn't properly recorded in studio, with voices being the ONLY centered track. If anything else (like drums or bass) is ALSO centered, you're dead.
Also, no algorithm would work "out-of-the-box": you'll need to set some parameters in order to let it work properly.
For example, to setup band-stop filters:
- Common human voices (spoken): 500-1000Hz
- Male reference range: 64-523Hz
- Female reference range: 160-1200Hz
- Male bass: 82-392Hz
- Male baritone: 123-493Hz
- Male tenor: 164-698Hz
- Female bass: 82-392Hz
- Female mezzo-soprano: 123-493Hz
- Female soprano: 220-1100
So if your song's singers are both a male bass and a female soprano, you'll need to cut all frequencies from 82 to 392 Hz (male) and from 220 to 1100 Hz (female). So finally, everything between 82 to 1100 Hz... That won't let so much instruments left! So you'll need to put markers on your timeline, when each singer is singing, and cut bands ONLY during these short periods - so you won't damage too much instruments.
The "right" way should be to try most of these tricks, on the tiniest possible durations (i.e. when a human is singing). You should first start to tag all these intervals so that you can try each algorithm on each sound sequence, and keep each time only the best one.
But if you're already lost by a "simple" phase cancellation, you may never be able to properly clean your song from its vocals. It's a quite advanced signal processing, and it will be even harder to apply if you don't know anything about signal processing.

- 1,483
- 4
- 13
-
thanks a lot @Wisblade for your explanation but I don't know about signal processing and I just want to create an app ,I did not know that it is a completely different field :) . I can not manipulate the frequency in app developing . maybe other friends can help . – Ramin Zirak Apr 20 '22 at 11:49
-
@RaminZirak Or you can learn: wanting something to be done is a good motivation. For example, for phase cancellation, you need first to understand how you'll get right and left PCM channels (it can be up to 8 channels for a 7:1 source..., may need codecs for that). THEN, you can do the phase cancellation before sending it to speakers or to a codec... For working on frequencies, it's simply applying a FFT, set some parts to 0, then do an IFFT (inverse) to get the sound again. Nothing awfully complicated, you simply need to search and process it little by little. – Wisblade Apr 20 '22 at 12:25
-
Thanks @Wisblade for advice ,it seems learnable :) , but I'm a developer, not a song editor and to learn it, I have to stay away from developing for a while,it maybe takes a while. due to a series of problems I have, I now have little time to learn something new. I will definitely learn it later. – Ramin Zirak Apr 20 '22 at 12:59
-
@RaminZirak If you don't mind, what is the purpose of this app? A lot of devs make "challenging" things when they're bored from work - or when they can't do up to their standards at work. You can implement things without being a specialist: you need the algorithm, not the theory behind. Researchers, engineers, technicians, workers: you don't need to know the other jobs to do yours. You need all of them to make something useful, however. In your case: once you did the basic code, try on several songs to find an "easy" one... Then try to make it works on "hard" ones. Step by step. – Wisblade Apr 20 '22 at 14:57
-
Your words were very beautiful and valuable to me and made me a little interested in it :).thank you alot .I will do my best. – Ramin Zirak Apr 20 '22 at 17:05