AudioFormat

class AudioFormat : Parcelable


Represents the format configuration of audio data used by the Studio Sound API.

This class defines the fundamental properties required to interpret and process raw PCM audio streams, including the sample rate in Hz (8,000 Hz to 48,000 Hz), the audio sample encoding format (ENCODING_PCM_FLOAT), and the number of audio channels (mono or stereo).

Instances of this class are immutable and safe to pass across IPC boundaries.

Summary

Nested types

Builder for constructing AudioFormat instances.

Public constructors

AudioFormat(sampleRate: Int, @AudioEncoding encoding: Int, channelCount: Int)

Constructs a new AudioFormat with the specified properties.

Public functions

Boolean
equals(o: Any?)
Int
String!
Unit
writeToParcel(dest: Parcel!, flags: Int)

Inherited functions

From android.os.Parcelable

Constants

CREATOR

const val CREATOR: Parcelable.Creator<AudioFormat!>!

Public constructors

AudioFormat

AudioFormat(sampleRate: Int, @AudioEncoding encoding: Int, channelCount: Int)

Constructs a new AudioFormat with the specified properties.

Parameters
sampleRate: Int

the sample rate in Hz (between 8,000 and 48,000 Hz, e.g., 44100, 48000)

@AudioEncoding encoding: Int

the audio encoding format constant (ENCODING_PCM_FLOAT)

channelCount: Int

the number of audio channels (1 for mono, 2 for stereo)

Public functions

equals

fun equals(o: Any?): Boolean

hashCode

fun hashCode(): Int

toString

fun toString(): String!

writeToParcel

fun writeToParcel(dest: Parcel!, flags: Int): Unit

Public properties

channelCount

val channelCount: Int

encoding

val encoding: Int

sampleRate

val sampleRate: Int