# Mic Input with Unity and C#

**URL:** https://qa.fmod.com/t/mic-input-with-unity-and-c/15953
**Category:** Unity
**Tags:** unity, csharp
**Created:** [July 8, 2020, 8:42pm UTC](https://qa.fmod.com/t/mic-input-with-unity-and-c/15953 "2020-07-08T20:42:35Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![nielsduif](https://avatars.discourse-cdn.com/v4/letter/n/779978/32.png) [@nielsduif](https://qa.fmod.com/u/nielsduif)
#### Post date: [July 8, 2020, 8:42pm UTC](https://qa.fmod.com/t/mic-input-with-unity-and-c/15953/1 "2020-07-08T20:42:35Z")

</div>

Hey there,

I recently stumbled upon a problem that I can’t wrap my head around.  
In a nutshell, I’d like to:

- Record input from a microphone
- Adjust local scales of game objects in Unity based on the volume of the mic input

While surfing the web, I found some similar questions about microphone input combined with FMOD.  
I followed the steps those people took, and ended up with a Programmer Instrument in my FMOD project, combined with the C# script that comes with it (from the API Documentation, the Programmer Instrument example cs). Now the real question:  
How do I start recording from a mic?  
I’ve read thru the documentation, but can’t find any good examples that are able to solve my problem.  
How do I use System::recordStart with C#, same for Sound::lock.

I’ve done similar stuff like this with the Unity sound system:  
Scaling based of an audio file/mic input

[![](https://img.youtube.com/vi/Wi26BmVEtjU/hqdefault.jpg "Scaling based of an audio file/mic input") ](https://www.youtube.com/watch?v=Wi26BmVEtjU)

In the Tutorial Unity Files, I found the visualizer scene, which helped me a ton with understanding how things work and I was able to convert my Unity audio method (1st scene in the video), to do the exact same thing but with FMOD:

[![](https://img.youtube.com/vi/5uioNApp6sw/maxresdefault.jpg "FMOD scaling") ](https://www.youtube.com/watch?v=5uioNApp6sw)

As conclusion, how do I start recording microphone input, combined with Unity and C#.

Thanks in advance,  
Niels 🙂

---

<div class="post-metadata">

### Author: ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)
#### Post date: [July 21, 2020, 1:15am UTC](https://qa.fmod.com/t/mic-input-with-unity-and-c/15953/2 "2020-07-21T01:15:13Z")

</div>

It looks like you have made some progress:

> [@Mic state when recording](https://qa.fmod.com/t/mic-state-when-recording/15977):
>
> Hey there, I recently posted a question and kept digging further. I now got a mic working with FMOD in Unity, and am able to hear myself. There is some weird stuff happening still though. When I talk thru the microphone, it sounds very distorted. Another odd thing that happens is the recording looping back. So after a little while, I hear the recording of before basically. Feel like I’m getting closer to my endpoint, but currently stuck on the mic sounding distorted and the looping. A comple…

---

<div class="post-metadata">

### Author: ![TheMorphy](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@TheMorphy](https://qa.fmod.com/u/TheMorphy)
#### Post date: [July 3, 2021, 11:53am UTC](https://qa.fmod.com/t/mic-input-with-unity-and-c/15953/3 "2021-07-03T11:53:12Z")

</div>

Hi nielsduif! Could you please explain how do you get microphone input (or microphone loudness) using fmod?

---

<div class="post-metadata">

### Author: ![Zacoriot](https://avatars.discourse-cdn.com/v4/letter/z/f08c70/32.png) [@Zacoriot](https://qa.fmod.com/u/Zacoriot)
#### Post date: [February 27, 2024, 5:50pm UTC](https://qa.fmod.com/t/mic-input-with-unity-and-c/15953/4 "2024-02-27T17:50:19Z")

</div>

Hey,

Do you have access to this script still? I am trying to achieve a similar thing but cannot work it out!

Thanks in advance

---

<div class="post-metadata">

### Author: ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)
#### Post date: [March 1, 2024, 2:47am UTC](https://qa.fmod.com/t/mic-input-with-unity-and-c/15953/5 "2024-03-01T02:47:27Z")

</div>

We have a ‘[record example](https://fmod.com/docs/2.02/unity/examples-record.html)’ in our Unity documentation under Scripting Examples.
