Added in API level 24

AudioRecordingConfiguration


class AudioRecordingConfiguration : Parcelable
kotlin.Any
   ↳ android.media.AudioRecordingConfiguration

The AudioRecordingConfiguration class collects the information describing an audio recording session.

Direct polling (see AudioManager.getActiveRecordingConfigurations()) or callback (see AudioManager.registerAudioRecordingCallback(android.media.AudioManager.AudioRecordingCallback, android.os.Handler) methods are ways to receive information about the current recording configuration of the device.

An audio recording configuration contains information about the recording format as used by the application (getClientFormat(), as well as the recording format actually used by the device (getFormat()). The two recording formats may, for instance, be at different sampling rates due to hardware limitations (e.g. application recording at 44.1kHz whereas the device always records at 48kHz, and the Android framework resamples for the application).

The configuration also contains the use case for which audio is recorded (getClientAudioSource()), enabling the ability to distinguish between different activities such as ongoing voice recognition or camcorder recording.

Summary

Inherited constants
Public methods
Int

Boolean
equals(other: Any?)

AudioDeviceInfo!

Returns information about the audio input device used for this recording.

Int

Returns the audio source currently used to configure the capture path.

Int

Returns the session number of the recording, see AudioRecord.getAudioSessionId().

Int

Returns the audio source selected by the client.

MutableList<AudioEffect.Descriptor!>

Returns the list of AudioEffect.Descriptor for all effects currently enabled on the audio capture client (e.g.

AudioFormat!

Returns the audio format at which the client application is recording audio.

MutableList<AudioEffect.Descriptor!>

Returns the list of AudioEffect.Descriptor for all effects currently enabled on the capture stream.

AudioFormat!

Returns the audio format at which audio is recorded on this Android device.

Int

Boolean

Returns true if the audio returned to the client is currently being silenced by the audio framework due to concurrent capture policy (e.g the capturing application does not have an active foreground process or service anymore).

Unit
writeToParcel(dest: Parcel, flags: Int)

Properties
static Parcelable.Creator<AudioRecordingConfiguration!>

Public methods

describeContents

Added in API level 24
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

equals

Added in API level 24
fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getAudioDevice

Added in API level 24
fun getAudioDevice(): AudioDeviceInfo!

Returns information about the audio input device used for this recording.

Return
AudioDeviceInfo! the audio recording device or null if this information cannot be retrieved

getClientAudioSessionId

Added in API level 24
fun getClientAudioSessionId(): Int

Returns the session number of the recording, see AudioRecord.getAudioSessionId().

Return
Int the session number.

getClientEffects

Added in API level 29
fun getClientEffects(): MutableList<AudioEffect.Descriptor!>

Returns the list of AudioEffect.Descriptor for all effects currently enabled on the audio capture client (e.g. AudioRecord or MediaRecorder).

Return
MutableList<AudioEffect.Descriptor!> List of AudioEffect.Descriptor containing all effects enabled for the client. This value cannot be null.

getClientFormat

Added in API level 24
fun getClientFormat(): AudioFormat!

Returns the audio format at which the client application is recording audio. Note that it may differ from the actual recording format (see getFormat()).

Return
AudioFormat! the recording format

getEffects

Added in API level 29
fun getEffects(): MutableList<AudioEffect.Descriptor!>

Returns the list of AudioEffect.Descriptor for all effects currently enabled on the capture stream.

Return
MutableList<AudioEffect.Descriptor!> List of AudioEffect.Descriptor containing all effects enabled on the capture stream. This can be different from the list returned by getClientEffects() if another capture is active. This value cannot be null.

getFormat

Added in API level 24
fun getFormat(): AudioFormat!

Returns the audio format at which audio is recorded on this Android device. Note that it may differ from the client application recording format (see getClientFormat()).

Return
AudioFormat! the device recording format

hashCode

Added in API level 24
fun hashCode(): Int
Return
Int a hash code value for this object.

isClientSilenced

Added in API level 29
fun isClientSilenced(): Boolean

Returns true if the audio returned to the client is currently being silenced by the audio framework due to concurrent capture policy (e.g the capturing application does not have an active foreground process or service anymore).

Return
Boolean true if captured audio is silenced, false otherwise .

writeToParcel

Added in API level 24
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit
Parameters
dest Parcel: The Parcel in which the object should be written. This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 24
static val CREATOR: Parcelable.Creator<AudioRecordingConfiguration!>