UniMic
A convenience wrapper for Unity's Microphone class.
API
Mic class in the Adrenak.UniMic namespace is a singleton and is accessed using Mic.Instance
Properties
-
IsRecordingReturns if the Mic instance is recording audio -
FrequencyThe frequency of the Microphone AudioClip -
SampleThe last populated sample of the audio data -
SampleDurationMSThe duration of the sample segment in milliseconds that the instance maintains and fires in events. -
SampleLengthThe number of samples in the sample segment -
AudioClipThe innerAudioClipof the instance -
DevicesThe recording devices that are connected to the machine running the code -
CurrentDeviceIndexThe index of the active device in theDeviceslist -
CurrentDeviceNameThe name of the active device
Events
-
OnStartRecordingEvent fired when the instance starts to record the audio -
OnStopRecordingEvent fired when the instance stops recording the audio -
OnSampleReadyEvent fired when a sample ofSampleLengthhas been populated by the instance
Methods
-
UpdateDevicesupdates the list of available recording devices. -
ChangeDevicechanges the recording device. The method internally restarts the recording processArgumentsint indexthe index of the device in theDeviceslist
Returnsvoid
-
StartRecordingstarts the microphone recordingArgumentsint frequency=16000the frequency of the innerAudioClipint sampleLenthe length of a single sample segment that the instance keeps and fires on event
Returnsvoid
-
StopRecordingstops the microphone recordingReturnsvoid