Skip to main content
Version: 2.x

Class OdinMicrophoneReader

Handles microphone input data and sends input to ODIN

This convenient class gathers input audio data from Unity managed Microphone to pass the data with OdinNative.Unity.Audio.OdinMicrophoneReader.OnAudioData event to other components.

Assembly: cs.temp.dll.dll
Declaration
public class OdinMicrophoneReader : MonoBehaviour

Properties

HasPermission

Check if the user has authorized use of the microphone

Declaration
public bool HasPermission { get; }

MicrophoneSamplerate

Declaration
public int MicrophoneSamplerate { get; }

MicrophoneChannels

Declaration
public int MicrophoneChannels { 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

Samplerate

Declaration
public int Samplerate

CustomInputDevice

Enable/Disable the use of OdinNative.Unity.Audio.OdinMicrophoneReader.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 UnityEngine.Microphone.Start (Microphone.Start) in OdinNative.Unity.Audio.OdinMicrophoneReader.Start

Declaration
public bool AutostartListen

CustomMicVolumeScale

Declaration
public bool CustomMicVolumeScale

MicVolumeScale

Declaration
public float MicVolumeScale

OnAudioData

Declaration
public UnityAudioData OnAudioData

OnMicrophoneData

Event is fired if raw microphone data is available

Declaration
public OdinMicrophoneReader.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()