AudioConfig

class AudioConfig(val mimeType: String = MediaFormat.MIMETYPE_AUDIO_AAC, val startBitrate: Int = 128000, val sampleRate: Int = getDefaultSampleRate(mimeType), val channelConfig: Int = AudioFormat.CHANNEL_IN_STEREO, val byteFormat: Int = AudioFormat.ENCODING_PCM_16BIT, val profile: Int = getDefaultProfile(mimeType), val enableEchoCanceler: Boolean = true, val enableNoiseSuppressor: Boolean = true) : Config

Audio configuration class. If you don't know how to set class members, Video encoding recommendations should give you hints.

See also

Constructors

Link copied to clipboard
constructor(mimeType: String = MediaFormat.MIMETYPE_AUDIO_AAC, startBitrate: Int = 128000, sampleRate: Int = getDefaultSampleRate(mimeType), channelConfig: Int = AudioFormat.CHANNEL_IN_STEREO, byteFormat: Int = AudioFormat.ENCODING_PCM_16BIT, profile: Int = getDefaultProfile(mimeType), enableEchoCanceler: Boolean = true, enableNoiseSuppressor: Boolean = true)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Audio byte format.

Link copied to clipboard

Audio channel configuration. From AudioRecord API: " AudioFormat#CHANNEL_IN_MONO is guaranteed to work on all devices."

Link copied to clipboard

Get default encoder name. If name is null, it won't be possible to start a stream.

Link copied to clipboard

Enable/disable audio echo canceller. If device does not have an echo canceller, it does nothing.

Link copied to clipboard

Enable/disable audio noise suppressor. If device does not have a noise suppressor, it does nothing.

Link copied to clipboard

Check if this configuration is supported by the default encoder. If format is not supported, it won't be possible to start a stream.

Link copied to clipboard

The encoder mime type. Only MediaFormat.MIMETYPE_AUDIO_AAC is supported yet.

Link copied to clipboard
val profile: Int = 0

The encoder profile. Only applicable to AAC, AVC, HEVC, VP9, AV1.

Link copied to clipboard

Audio capture sample rate in Hz. From AudioRecord API: "44100Hz is currently the only rate that is guaranteed to work on all devices, but other rates such as 22050, 16000, and 11025 may work on some devices."

Link copied to clipboard

The encoder bitrate in bits/s.

Functions

Link copied to clipboard

Check if this configuration is supported by the specified encoder. If format is not supported, it won't be possible to start a stream.

Link copied to clipboard
open override fun toString(): String