API / Minn\Media\Av / Flac

Flac final class

Minn\Media\Av\Flac · public/minn/src/Minn/Media/Av/Flac.php · 115 lines

FLAC, on its own or as the first packet of an Ogg stream, as the reference's media reader measures it (probe media-meta): the stream information block gives the rate, channels, depth and samples, the comment block names the encoder, and a picture block is the cover.

Uses 1

Public

staticread(Minn\Media\Av\Source $source): array#

A native FLAC file's analysis: the data after the metadata blocks, the playing time from the sample count and a bitrate over the whole file.

@return array<string, mixed>
staticstream(array $info, int|float|null $bitrate, ?string $vendor): array#

The stream a FLAC stream information block and vendor describe, with the bitrate when one is known.

$infoarray{sampleRate: int, channels: int, bits: int, samples: int}
@return array<string, mixed>
staticstreamInfo(string $block): ?array#

A stream information block's rate, channels, depth and sample count.

@return array{sampleRate: int, channels: int, bits: int, samples: int}|null

Internals 2

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privateblocks(Minn\Media\Av\Source $source, int $at): array#

The metadata blocks from $at: the stream information, the comment block's vendor, the first picture, and where the audio begins.

@return array{info: ?array, vendor: ?string, picture: ?array, end: int}
privatepicture(string $body): ?array#

A picture block's image: its type and bytes.

@return array<string, mixed>|null