FlacStreamMetadata
@UnstableApi
class FlacStreamMetadata
Holder for FLAC metadata.
See the following sections of RFC 9639:
Summary
Nested types |
|---|
|
A FLAC seek table. |
Constants |
|
|---|---|
const Int |
NOT_IN_LOOKUP_TABLE = -1Indicates that a value is not in the corresponding lookup table. |
Public constructors |
|---|
FlacStreamMetadata(data: ByteArray!, offset: Int)Parses binary FLAC stream info metadata. |
Public functions |
|
|---|---|
FlacStreamMetadata! |
copyWithPictureFrames(pictureFrames: (Mutable)List<PictureFrame!>!)Returns a copy of |
FlacStreamMetadata! |
copyWithSeekTable(seekTable: FlacStreamMetadata.SeekTable?)Returns a copy of |
FlacStreamMetadata! |
copyWithVorbisComments(vorbisComments: (Mutable)List<String!>!)Returns a copy of |
Long |
Returns the approximate number of bytes per frame for the current FLAC stream. |
Int |
Returns the bitrate of the stream after it's decoded into PCM. |
Long |
Returns the duration of the FLAC stream in microseconds, or |
Format! |
Returns a |
Int |
Returns the maximum size for a decoded frame from the FLAC stream. |
Metadata? |
Returns a copy of the content metadata with entries from |
Long |
getSampleNumber(timeUs: Long)Returns the sample number of the sample at a given time. |
Public properties |
|
|---|---|
Int |
Number of bits per sample. |
Int |
Lookup key corresponding to the number of bits per sample of the stream, or |
Int |
Number of audio channels. |
Int |
Maximum number of samples per block. |
Int |
Maximum frame size in bytes, or 0 if the value is unknown. |
Int |
Minimum number of samples per block. |
Int |
Minimum frame size in bytes, or 0 if the value is unknown. |
Int |
Sample rate in Hertz. |
Int |
Lookup key corresponding to the stream sample rate, or |
FlacStreamMetadata.SeekTable? |
Seek table, or |
Long |
Total number of samples, or 0 if the value is unknown. |
Constants
NOT_IN_LOOKUP_TABLE
const val NOT_IN_LOOKUP_TABLE = -1: Int
Indicates that a value is not in the corresponding lookup table.
Public constructors
FlacStreamMetadata
FlacStreamMetadata(data: ByteArray!, offset: Int)
Parses binary FLAC stream info metadata.
Public functions
copyWithPictureFrames
fun copyWithPictureFrames(pictureFrames: (Mutable)List<PictureFrame!>!): FlacStreamMetadata!
Returns a copy of this with the given picture frames added to the metadata.
copyWithSeekTable
fun copyWithSeekTable(seekTable: FlacStreamMetadata.SeekTable?): FlacStreamMetadata!
Returns a copy of this with the seek table replaced by the one given.
copyWithVorbisComments
fun copyWithVorbisComments(vorbisComments: (Mutable)List<String!>!): FlacStreamMetadata!
Returns a copy of this with the given Vorbis comments added to the metadata.
getApproxBytesPerFrame
fun getApproxBytesPerFrame(): Long
Returns the approximate number of bytes per frame for the current FLAC stream.
getDecodedBitrate
fun getDecodedBitrate(): Int
Returns the bitrate of the stream after it's decoded into PCM.
getDurationUs
fun getDurationUs(): Long
Returns the duration of the FLAC stream in microseconds, or TIME_UNSET if the total number of samples if unknown.
getFormat
fun getFormat(streamMarkerAndInfoBlock: ByteArray!, id3Metadata: Metadata?): Format!
Returns a Format extracted from the FLAC stream metadata.
streamMarkerAndInfoBlock is updated to set the bit corresponding to the stream info last metadata block flag to true.
getMaxDecodedFrameSize
fun getMaxDecodedFrameSize(): Int
Returns the maximum size for a decoded frame from the FLAC stream.
getMetadataCopyWithAppendedEntriesFrom
fun getMetadataCopyWithAppendedEntriesFrom(other: Metadata?): Metadata?
Returns a copy of the content metadata with entries from other appended.
getSampleNumber
fun getSampleNumber(timeUs: Long): Long
Returns the sample number of the sample at a given time.
| Parameters | |
|---|---|
timeUs: Long |
Time position in microseconds in the FLAC stream. |
| Returns | |
|---|---|
Long |
The sample number corresponding to the time position. |
Public properties
bitsPerSampleLookupKey
val bitsPerSampleLookupKey: Int
Lookup key corresponding to the number of bits per sample of the stream, or NOT_IN_LOOKUP_TABLE if it is not in the lookup table.
This key is used to indicate the number of bits per sample in the frame header for the most common values.
The sample size lookup table is described in https://xiph.org/flac/format.html#frame_header.
sampleRateLookupKey
val sampleRateLookupKey: Int
Lookup key corresponding to the stream sample rate, or NOT_IN_LOOKUP_TABLE if it is not in the lookup table.
This key is used to indicate the sample rate in the frame header for the most common values.
The sample rate lookup table is described in https://xiph.org/flac/format.html#frame_header.