API reference
API reference
Select your platform
No SDKs available
No versions available

Mic Class

A simple mic playback class
Meta::WitAi::Lib::Mic extends MonoBehaviour.
Meta::WitAi::Lib::Mic extends Meta.WitAi.Interfaces.IAudioInputSource.
Meta::WitAi::Lib::Mic extends Meta.WitAi.Lib.BaseAudioClipInput.

Overview

Data Fields

override AudioClip
Clip[Get]
The audio clip obtained from Microphone.Start
override int
The current clip position of the
override bool
Always allow initial activation
override bool
Due to Microphone.Start & Microphone.End taking so long, activate on enable
float
Searches for mics for this long following an activation request.
int
Total amount of seconds included within the mic audio clip buffer
override int
Getter for audio mic sample audio capture in samples per second
bool
bool

Properties

List< string >
Devices[Get]
List of all the available Mic devices
int
Index of the current Mic device in m_Devices
string
Gets the name of the Mic device currently in use
int

Events

Action
Action
Action< int, float[], float >
Action

Public Member Functions

void
SetAudioSampleRate
( int newSampleRate )
Sets the new audio sample rate if possible
void
ChangeMicDevice
( int index )
Changes to a Mic device for Recording
void
StartRecording
( int sampleDurationMS )
Begins reading with a specified number of ms per sample
void
Stop recording audio from the provided mic source
void

Object Data

override IEnumerator
Wait for devices to exist & then start mic
override void
Stop microphone for deactivation

Details

Fields

override AudioClip Meta.WitAi.Lib.Mic.Clip
The audio clip obtained from Microphone.Start
override int Meta.WitAi.Lib.Mic.ClipPosition
The current clip position of the
override bool Meta.WitAi.Lib.Mic.CanActivateAudio
Always allow initial activation
override bool Meta.WitAi.Lib.Mic.ActivateOnEnable
Due to Microphone.Start & Microphone.End taking so long, activate on enable
float Meta.WitAi.Lib.Mic.MicStartTimeout
Searches for mics for this long following an activation request.
int Meta.WitAi.Lib.Mic.MicBufferLength
Total amount of seconds included within the mic audio clip buffer
override int Meta.WitAi.Lib.Mic.AudioSampleRate
Getter for audio mic sample audio capture in samples per second
bool Meta.WitAi.Lib.Mic.IsRecording
No description available.
AudioEncoding Meta.WitAi.Lib.Mic.AudioEncoding
No description available.
bool Meta.WitAi.Lib.Mic.IsInputAvailable
No description available.

Properties

List<string> Meta.WitAi.Lib.Mic.Devices
List of all the available Mic devices
int Meta.WitAi.Lib.Mic.CurrentDeviceIndex
Index of the current Mic device in m_Devices
string Meta.WitAi.Lib.Mic.CurrentDeviceName
Gets the name of the Mic device currently in use
int Meta.WitAi.Lib.Mic.AudioClipSampleRate
No description available.

Events

Action Meta.WitAi.Lib.Mic.OnStartRecording ( )
No description available.
Action Meta.WitAi.Lib.Mic.OnStartRecordingFailed ( )
No description available.
Action<int, float[], float> Meta.WitAi.Lib.Mic.OnSampleReady ( )
No description available.
Action Meta.WitAi.Lib.Mic.OnStopRecording ( )
No description available.

Member Functions

void Meta.WitAi.Lib.Mic.SetAudioSampleRate
( int newSampleRate )
Sets the new audio sample rate if possible
Parameters
newSampleRate
New sample rate
void Meta.WitAi.Lib.Mic.ChangeMicDevice
( int index )
Changes to a Mic device for Recording
Parameters
index
The index of the Mic device. Refer to Devices
void Meta.WitAi.Lib.Mic.StartRecording
( int sampleDurationMS )
Begins reading with a specified number of ms per sample
void Meta.WitAi.Lib.Mic.StopRecording ( )
Stop recording audio from the provided mic source
void Meta.WitAi.Lib.Mic.CheckForInput ( )
No description available.

Object Data

override IEnumerator Meta.WitAi.Lib.Mic.HandleActivation ( )
Wait for devices to exist & then start mic
override void Meta.WitAi.Lib.Mic.HandleDeactivation ( )
Stop microphone for deactivation
Did you find this page helpful?
Thumbs up icon
Thumbs down icon