Vixen
02b45cc4
csharp
public sealed class PcmPacketDecoder

The decoder for audio that was never encoded.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Matroska's uncompressed codecs: A_PCM/INT/LIT at 8, 16, 24 or 32 bits, and A_PCM/FLOAT/IEEE at 32 or 64. Big-endian integer PCM — A_PCM/INT/BIG — exists in the specification and is not handled, because nothing has written it since the format's first year and a byte-swapped path nobody exercises is a path that is wrong.

8-bit is unsigned and everything else is signed. That is not this module's invention; it is what WAV did in 1991 and what every specification since has inherited. Decoding 8-bit as signed gives a track that is loud, distorted, and centred half a scale off.

Fields and properties (2)

  • public AudioFormat Format

    The rate and channel count it produces.

  • public int MaxFramesPerPacket

Methods (4)

  • public PcmPacketDecoder(AudioFormat format, int bitDepth, bool isFloat)

    Creates a decoder for a track's stated format.

  • public int Decode(ReadOnlySpan<byte> packet, Span<float> destination)

    Decodes a packet.

  • public void Reset()
  • public void Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Used by (2)

  • MatroskaAudioTestsVixen.Video.Tests
  • PcmPacketDecoderFactoryVixen.Video