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

AudioBuffer Class

Extends MonoBehaviour
This class is responsible for managing a shared audio buffer for receiving microphone data. It is used by voice services to grab audio segments from the AudioBuffer's internal ring buffer.

Properties

static AudioBuffer Instance[Get]
The current audio input source
Returns true if a component has requested audio but
Current max audio level, defaults to -1 when off

Fields

The audio buffer's encoding settings. Mic.Encoding is re-encoded to match the desired transmission encoding
Events triggered when AudioBuffer processes and receives audio data.
The minimum unsigned frequency handled by the microphone
The minimum unsigned frequency handled by the microphone
Returns true if an input audio source (for example Mic) is available

Member Functions

void OnApplicationQuit ( )
Returns true if a component has registered to receive audio data and if the mic is actively capturing data that will be shared
Parameters
component
The source of the StartRecording
Returns
True if this component has called StartRecording
Adds a component to the active list of recorders. If the AudioBuffer isn't already storing mic data in the ring buffer, it will start to store data in the ring buffer.
Parameters
component
A component to use as a key that will keep the audio buffer actively recording
Releases the recording state on the AudioBuffer for the given component. If no components are holding a lock on the AudioBuffer it will stop populating the ring buffer.
Parameters
component
The component used to start recording
Create a marker at the current audio input time.
Returns
A marker representing a position in the ring buffer that can be read as long as the the ring buffer hasn't wrapped and replaced the start of this marker yet.
Creates a marker with an offset
Parameters
offset
Number of seconds to offset the marker by
Did you find this page helpful?
Thumbs up icon
Thumbs down icon