Skip to main content
Version: 1.x

Class MicrophoneReader

Handles microphone input data and sends input to ODIN

Declaration
public class MicrophoneReader : MonoBehaviour

Properties

HasPermission

Check if the user has authorized use of the microphone

Declaration
public bool HasPermission { get; }

Fields

RedirectCapturedAudio

Skips registered PushAudio for the OnMicrophoneData event

Declaration
public bool RedirectCapturedAudio

SilenceCapturedAudio

Zero out the event audio buffer for PushAudio.

Declaration
public bool SilenceCapturedAudio

ContinueRecording

Declaration
public bool ContinueRecording

AudioClipLength

Declaration
public int AudioClipLength

OverrideSampleRate

Use set OdinNative.Unity.Audio.MicrophoneReader.SampleRate on true, OdinNative.Unity.OdinEditorConfig.DeviceSampleRate on false

Declaration
public bool OverrideSampleRate

SampleRate

The recording OdinNative.Core.MediaSampleRate

Declaration
public MediaSampleRate SampleRate

CustomInputDevice

Enable/Disable the use of OdinNative.Unity.Audio.MicrophoneReader.InputDevice as a new/fixed device name

Declaration
public bool CustomInputDevice

InputDevice

The device name to use as microphone in Unity. (i.e Microphone.Start)

Declaration
public string InputDevice

AutostartListen

Use (Microphone.Start) in OdinNative.Unity.Audio.MicrophoneReader.Start

Declaration
public bool AutostartListen

CustomMicVolumeScale

Declaration
public bool CustomMicVolumeScale

MicVolumeScale

Declaration
public float MicVolumeScale

Loopback

Create and play (AudioSource) with a Microphone (AudioClip) on loop.

Declaration
public bool Loopback

OnMicrophoneData

Event is fired if raw microphone data is available

Declaration
public MicrophoneReader.MicrophoneCallbackDelegate OnMicrophoneData

Methods

StartListen()

Start Unity microphone capture

Declaration
public bool StartListen()
Returns

System.Boolean

StopListen()

Stop Unity Microphone capture if this AudioSender created the recording

Declaration
public void StopListen()