AudioEngine

class AudioEngine(val context: Context, config: AudioEngineConfig) : NDKBinding

Creates an AudioEngine class

Parameters

context

application context

config

config of the audio engine. See AudioEngineConfig for description of the parameters

Constructors

Link copied to clipboard
constructor(context: Context, sampleRate: Int? = null, micInputPreset: MicInputPreset? = null, performanceMode: PerformanceMode? = null, outputUsage: OutputUsage? = null, microphoneEnabled: Boolean? = null, outputEnabled: Boolean? = null)

Creates an AudioEngine class

constructor(context: Context, config: AudioEngineConfig)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Indicates whether the A2DP Bluetooth profile should always be used. Default is false

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Indicates the microphone input preset of the audio engine. Default is generic

Link copied to clipboard

Indicates whether the microphone input is enabled on the audio engine. Default is false

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Indicates whether the audio output is enabled on the audio engine. Default is true

Link copied to clipboard

Indicates the usage type of the output of the audio engine. Default is media

Link copied to clipboard

Indicates the performance mode of the audio engine. Default is none

Link copied to clipboard

Indicates the sample rate of the audio engine in Hz. Default is 48000

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard

Retrieves the current input latency of the audio stream.

Link copied to clipboard

Retrieves the current output latency of the audio stream.

Link copied to clipboard

Retrieves the size of the input buffer in milliseconds.

Link copied to clipboard

Retrieves the size of the output buffer in milliseconds.

Link copied to clipboard
external fun init(sampleRate: Int, micInputPreset: Int, performanceMode: Int, outputUsage: Int, enableInput: Int, enableOutput: Int)
open fun init()
Link copied to clipboard

Checks if latency detection is supported on the current device.

Link copied to clipboard
external fun setInputAndOutputDeviceId(inputId: Int, outputId: Int)

Sets the preferred input and output device id

Link copied to clipboard
external fun start(audioGraph: AudioGraph)
Link copied to clipboard
external fun stop()