AudioCaptureModule | Inherits from: InworldAudioModule | Implements: IMicrophoneHandler
Core module responsible for microphone capture and audio input management in the Inworld framework. This module handles the low-level microphone operations and audio thread management. Only one AudioCaptureModule should be active in the module list at any time.
Note: This module is not available on Unity WebGL builds due to microphone access limitations.
Properties
Methods
Reference
autoStart
Determines whether the microphone should automatically start when this module initializes. When true, the microphone will begin capturing and calibration will start automatically.Returns
Type:bool
IsMicRecording
Gets whether the microphone is currently recording.Returns
Type:bool
StartMicrophone
Initializes and starts the microphone capture system using Unity’s built-in microphone functionality. Creates an AudioClip for continuous recording and begins the audio processing thread.Returns
Type:bool
Description: True if the microphone was successfully started and an AudioClip was created; otherwise, false.
StopMicrophone
Stop the microphone input using Unity’s official method.Returns
Type:bool
Description: True if successfully stopped, false otherwise.
ChangeInputDevice
Changes the microphone input device name.Parameters
| Parameter | Type | Description |
|---|---|---|
| deviceName | string | The device name to switch to. |
Returns
Type:bool
Description: True if the device was successfully changed, false otherwise.
ListMicDevices
Gets the list of available microphone devices.Returns
Type:List<string>
Description: A list of available microphone device names.
Important Notes
Single Instance Requirement
Only one AudioCaptureModule should be active in the module list at any time. Having multiple instances can cause conflicts in microphone access and audio processing.WebGL Compatibility
This module is not available on Unity WebGL builds due to microphone access limitations. The code is wrapped in#if !UNITY_WEBGL preprocessor directives.
Microphone vs Recording State
The Start/Stop microphone functions control the underlying audio capture system, separate from recording state which controls actual data transmission. Use these functions sparingly and only when necessary for system management.Automatic Initialization
WhenautoStart is enabled (default), the module will automatically:
- Start the microphone when the component initializes
- Begin calibration if the microphone starts successfully