Mic Decode Unity by JulianSchoenbaechler - 2

AudioInputsImporters & Exporters

Basic audio input signal decoder for Unity 3D. Detects loudness and frequency.

Unity 5.5.2f1GNU General Public License v3.0Updated 2 years agoCreated on March 8th, 2017
Go to source

MicDecode for Unity3D

MicDecode is a very basic audio input signal decoder for Unity 3D that can detect the loudness and frequency. Feel free to use these scripts in your own projects. Check out the releases tab for the newest unity-package of this project!


This software is released under the GNU General Public License (GPL) which can be found in the LICENSE file


  • Real-time audio input analysis
  • Calculates the RMS (root mean square) of audio waves
  • Calculates decibel values with given references
  • Calculates frequencies of audio waves
  • The amount of calculations and precision are adjustable

Basic Usage

Drag the Microphone Prefab into your scene and get its MicDecode component.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

// Using MicDecode
using JulianSchoenbaechler.MicDecode;

public class BasicUsage : MonoBehaviour
	// The MicDecode component (assign in inspector)
	public MicDecode microphone;

	// Initialization
	void Start()

You may want to fiddle with the settings of the component in the inspector.

Component Documentation


Name Function
StartRecording() Starts real-time recording and analysis from selected input device.
StopRecording() Stops running recording.
CalculateRMSValue() Manually calculates RMS value. The value is accessible through the VolumeRMS property.
CalculateDecibelValue() Manually calculates decibel value. The value is accessible through the VolumeDecibel property.
CalculateFrequency() Manually calculates frequency. The value is accessible through the Frequency property.


Name Access Function
SpectrumFFTWindow get / set Specifies the FFT window used for the spectrum analysis of the input signal.
IsRecording get Returns true if microphone is currently recording.
VolumeRMS get Returns the calculated RMS value.
VolumeDecibel get Returns the calculated decibel value.
Frequency get Returns the calculated frequency in Hz.


Julian Schönbächler https://julian-s.ch/ info[at]julian-s.ch

Project started in March 2017

Show all projects by JulianSchoenbaechler