Recording from a PC Microphone

Hi guys,

Im a student who is currently developing a game for a major work, and ive decided to go with unity. Now this is my first time ever using unity, so please forgive me if these questions seem painfully simple.

Right now, our game is quite dependant on the ability to record and analyze microphone input in real-time, and right now im not even sure how to get microphone input working, could any of you awesome people possibly guide me through this process ( i know, im basically asking for someone to hold my hand for a while since i need to learn this stuff kinda fast)

thanks for reading, any help would be greatly appreciated :smile:

Take a look at the microphone class. You’ll need to use the functions described on that page to record into a AudioClip object, which you can then use to do whatever you want.

Oh wow, i was wondering where that was, thanks :smile:

now just gotta find away to analyze the pitch and volume

Well, I know you can get the volume by using GetData() on the AudioClip. It returns values between -1 and 1, so the closer it is to those limits, the louder it is.

Not sure I can help you with analysing the pitch though, audio has never been one of my strong points. Good luck with it though :slight_smile:

Is there a way of doing the pitch and volume analysis without having to save the audio source every time??