Uploaded August 2018 | Updated November 2026, 1 day ago
I've never used Unity's Microphone API's before. Let's explore them together and get lost while we make something cool! Our goal is to create a frequency graph that can show the amplitude of different frequencies within our microphone (we won't be successful in building it).
There are two main parts to this project:
The first is a class that can accept Microphone input from a selected device and store that information into some sort of storage we can access from the rest of our code.
The second part is a visualizer that can take the stored microphone data and do something interesting with it. For this we'll just adjust the scaling of cubes based on amplitude.
Unity's Microphone class documentation: docs.unity3d.com/ScriptReference/Microphone.html
The support ticket I was leaning on during this for help can be found here: support.unity3d.com/hc/en-us/articles/206485253-How-do-I-get-Unity-to-playback-a-Microphone-input-in-real-time-
Join the World of Zero Discord channel: discord.gg/hU5Kq2u
I've never used Unity's Microphone API's before. Let's explore them together and get lost while we make something cool! Our goal is to create a frequency graph that can show the amplitude of different frequencies within our microphone (we won't be successful in building it).
There are two main parts to this project:
The first is a class that can accept Microphone input from a selected device and store that information into some sort of storage we can access from the rest of our code.
The second part is a visualizer that can take the stored microphone data and do something interesting with it. For this we'll just adjust the scaling of cubes based on amplitude.
Unity's Microphone class documentation: docs.unity3d.com/ScriptReference/Microphone.html
The support ticket I was leaning on during this for help can be found here: support.unity3d.com/hc/en-us/articles/206485253-How-do-I-get-Unity-to-playback-a-Microphone-input-in-real-time-
Join the World of Zero Discord channel: discord.gg/hU5Kq2u


![Adding an Accent to our Contrast Shader - Lets Make a Side Scrolling Shooter - Part 4
Lets spice up our our contrasting transition shader with an accent color that more clearly marks the border between one color and the next.
Part 1 of building this contrasting shader is here: https://www.youtube.com/watch?v=jJcSbixSy5c
Most of the magic of this shader happens in these lines which select the color we want to draw:
```
float maskPrimary = (_Transition + barrierSize [LESS THAN] maskStrength);
float maskSecondary = (_Transition - barrierSize [GREATER THAN] maskStrength);
float maskAccent = !(maskPrimary || maskSecondary);
o.Albedo = maskPrimary * _PrimaryColor
+ maskSecondary * _SecondaryColor
+ maskAccent * _AccentColor;
```
Come join the World of Zero Discord channel to talk software, game development and more: https://discord.gg/hU5Kq2u Adding an Accent to our Contrast Shader - Lets Make a Side Scrolling Shooter - Part 4](https://i.ytimg.com/vi/gu_bFoI2fIg/mqdefault.jpg)


Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u Implementing Scene Switching - An Elevator Between Scenes - Part 2](https://i.ytimg.com/vi/hr6ox4bg3Ow/mqdefault.jpg)


 we built previously.
Our shader is based off of this formula.
```
weight * colorA + (1 - weight) * colorB;
```
This formula uses a weight to balance between two colors. We can modify this by using a boolean value for the weight which will make it 1 when the boolean is true or 0 when the boolean is false. This will make it possible to turn our gradient between two colors into a hard transition instead.
We can modify our material in C# using code like this in order to animate it from code:
```csharp
material.SetFloat(_Transition, currentTransitionState);
```
Join the World of Zero Discord server: https://discord.gg/hU5Kq2u Color Contrast Shader - Lets Make a Side Scrolling Shooter - Part 3](https://i.ytimg.com/vi/jJcSbixSy5c/mqdefault.jpg)

- [`AnimFloat`](https://docs.unity3d.com/ScriptReference/AnimatedValues.AnimFloat.html)
- [`AnimQuaternion`](https://docs.unity3d.com/ScriptReference/AnimatedValues.AnimQuaternion.html)
- [`AnimVector3`](https://docs.unity3d.com/ScriptReference/AnimatedValues.AnimVector3.html)
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u Using AnimatedValues in Custom Unity Editors](https://i.ytimg.com/vi/jfhCaijXm6M/mqdefault.jpg)

