Ac3 final class
Minn\Media\Av\Ac3 · public/minn/src/Minn/Media/Av/Ac3.php · 40 lines
An AC-3 (Dolby Digital) frame's header as the reference's media reader reads it (probe media-meta): the rate, bitrate and channels, the low frequency channel counted as ".1". The centre mix level is read for every odd coding mode, mono included, so a mono frame reads its next bits as the low frequency channel; the channel modes follow the coding mode.
Constants and properties
| private | BITRATES = array ( 0 => 32, 1 => 40, 2 => 48, 3 => 56, 4 => 64, 5 => 80, 6 => 96, 7 => 112, 8 => 128, 9 => 160, 10 => 192, 11 => 224, 12 => 256, 13 => 320, 14 => 384, 15 => 448, 16 => 512, 17 => 576, 18 => 640, ) | |
| private | CHANNELS = array ( 0 => 2, 1 => 1, 2 => 2, 3 => 3, 4 => 3, 5 => 4, 6 => 4, 7 => 5, ) | |
| private | MODES = array ( 0 => 'stereo', 1 => 'mono', 2 => 'surround', 3 => 'stereo', 4 => 'stereo', 5 => 'surround', 6 => 'surround', 7 => 'surround', ) |
Public
| static | frame(string $bytes): ?array# | A frame's rate, bitrate, channels (an integer, or "n.1" with the low frequency channel) and channel mode; null for bytes that are no frame. @return array{sampleRate: int, bitrate: int, channels: int|string, mode: string}|null |
Nothing matches.