I’m researching if this is something possible to do with Unity or not.
The game i’m thinking, is a kind of Karaoke game, where Unity would play a music, the lyrics would should up, and the player would sing.
This lyrics would be stored in the game itself as a sound file, and the game would need to decode the singing of the player, compare it to the audio stored in the disk.
So basically, i need to know if there’s any audio functions that allow me to compare audio waves from sound files.
I was looking at the sound functions in the documentation, and i don’t see anything there that might do this.
If this is not possible, is there any way that i could incorporate FMOD into Unity using it as a external plugin ?
It’s not possible without plugins. But the method you’re talking about sounds absolutely over the top to me anyway. Get the pitch of the input waveform, compare it for plosives/transients, sure. But comparing it to a stored waveform instead of having something like a MIDI chart to compare to, I can’t see why that would be worth the coding effort at all.
(That kind of solution won’t work without plugins either.)
How could you store a singing file in MIDI’s ?
As far as i know, you cannot have digital voice recorgind in MIDIS.
Even if you could, you would still need to compare the midi samples (that could be digitized), with the ones being inputed from the microfone.
What kind of plugins could do this ? Are you aware of some ? All i can think is FMOD, but i don’t think i could interface FMOD with Unity, it would be two diferent sound libraries on the same system…
Karaoke games don’t compare waveforms. They analyze the incoming waveform, detect its pitch, and compare that to a MIDI chart. The easiest way to make such a chart would be to use pitch-to-MIDI on the vocal track, but you’d want someone to tweak that - using the unedited output would probably be disastrous.
There’s a freely available MIDI plugin for Unity, and I don’t know what it’s fully capable of, but as far as I know, it doesn’t have anything to do with pitch detection of audio. The only reason I could think that you’d want to compare the waveform from the mic to a recorded vocal is to check to see if the person can imitate the timbre/enunciation of the vocalist, and that’s going to be impossible for nearly everyone.