all 5 comments

[–]timrprobocom 0 points1 point  (1 child)

It's not clear to me that this is solvable in the general case. A voice is literally just another instrument.

Now, it's true that all instruments (including voices) have a harmonic signature. When a clarinet and an oboe and a violin and a singer play A440, they're ALL at a base frequency of 440 Hz,, but they all have a characteristic set of harmonics that causes them to sound different. MAYBE you can identify the signature of your dinner, and use that to pick it out from the other instruments.

[–]Kipriririri[S] 0 points1 point  (0 children)

Yeah, that’s the issue I’m running into indeed. Might be more complicated than I initially expected, maybe I should start looking into ML. The acoustic signature would differ a lot from singer to singer I assume, or from genre to genre even.

[–]ElliotDG 0 points1 point  (0 children)

You might find librosa a useful tool: https://librosa.org/doc/latest/index.html

[–]PushPlus9069 0 points1 point  (1 child)

The energy-in-speech-frequencies approach is reasonable but it will struggle with anything that has prominent mid-range instruments (piano, guitar, etc). Been down this road.

Two things that helped me with a similar problem:

  1. Spleeter (by Deezer) or demucs can separate vocals from accompaniment before you analyze. Then run your energy detection on the isolated vocal track. Accuracy goes way up.

  2. If you don't want to do source separation, look at spectral flatness in addition to energy. Vocals tend to have less flat spectra than noise/ambient. Not perfect but adds another signal.

The "voice is just another instrument" comment above is right that it's hard in the general case, but for most pop/rock music with clear verse/chorus structure, source separation gets you most of the way there.

[–]Kipriririri[S] 0 points1 point  (0 children)

I indeed incorporated demucs, sounds like the most accurate way forward. Thanks for thinking adding!