Unity3D: How to move an object using the device microphone as input?

I am trying to create a game that responds to a specific voice using a device microphone. But unity does not support something like that. However, they can record your voice using a microphone device .

var aud = GetComponent.<AudioSource>();
aud.clip = Microphone.Start("Built-in Microphone", true, 10, 44100);

      

can be used aud.pitch

as input to move a rigid body without writing it, but just get a real time input, say

ball.velocity.y = jumpHeight * aud.pitch; // move up

      

+3


source to share


1 answer


I believe the step is just the default that you can change to change the sound source. I doubt it actually determines the pitch value for each frame the audio is played in. However, you can use .NET libraries like Vocalyz



+2


source







All Articles