AudioFileInfo

data class AudioFileInfo(val format: AudioFileFormat, val sampleRate: Int, val channelCount: Int, val durationMs: Long, val bitRate: Int, val tags: AudioFileTags)

Describes the format and properties of an audio file.

Instances are returned by AudioFileReader.info and provide all the metadata needed to interpret the decoded audio data. This includes both technical properties (sample rate, channels, duration) and user-facing metadata (tags).

Calculating total frames

The total number of audio frames can be derived from the duration and sample rate:

val totalFrames = (info.durationMs * info.sampleRate) / 1000L

See also

Constructors

Link copied to clipboard
constructor(format: AudioFileFormat, sampleRate: Int, channelCount: Int, durationMs: Long, bitRate: Int, tags: AudioFileTags)

Properties

Link copied to clipboard

The encoded bit rate in bits per second.

Link copied to clipboard

The number of audio channels.

Link copied to clipboard

The total duration of the audio in milliseconds.

Link copied to clipboard

The container/codec format of the file (e.g., WAV, MP3, AAC, M4A).

Link copied to clipboard

The sample rate in Hz (e.g. 44100, 48000).

Link copied to clipboard

The metadata tags embedded in the file (title, artist, album, etc.).