Overview > Audio Collect ModuleClass:AudioCollectModule | Inherits from:InworldAudioModule | Implements:ICollectAudioHandlerAudio sampling module responsible for collecting audio data from the microphone input buffer. This module interfaces with Unity’s microphone system to continuously capture audio frames and populate the input buffer for further processing by other audio modules.
Note: This module is not available on Unity WebGL builds due to microphone access limitations.
Determines whether the module should automatically attempt to reconnect the microphone if it becomes disconnected.
When true, the module will automatically restart the microphone if recording stops unexpectedly.
Collects audio data from the microphone for the current frame and updates the input buffer.
Called by the AudioManager’s audio processing coroutine to capture approximately 0.1 seconds of audio data.
Uses Unity’s microphone API to retrieve the latest audio samples.
This module is not available on Unity WebGL builds due to microphone access limitations. The code is wrapped in #if !UNITY_WEBGL preprocessor directives.
When m_AutoReconnect is enabled (default), the module will automatically attempt to restart the microphone if it detects that recording has stopped. This helps maintain continuous audio capture in case of temporary microphone disconnections.
The module uses Unity’s Microphone.GetPosition() to track the current read position in the audio buffer. It handles buffer wraparound by checking if the current position is less than the last position, indicating the buffer has looped.
This module is called by the InworldAudioManager.CollectAudio() method during the audio processing pipeline, specifically between pre-processing and post-processing stages.