Vixen
02b45cc4
csharp
public interface IAudioPacketDecoder

Turns one packet of a container's audio track into frames.

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

Remarks

Not IAudioStreamDecoder, and the difference is the container. Vixen.Audio's decoder owns a file: it knows where it is, it can seek, it reads its own bytes. A packet decoder owns nothing — it is handed the bytes a demuxer already found and produces the samples in them. That is the shape Opus has and the shape a Matroska audio track needs, and it is why Vixen.Audio.Codecs.OpusPacketDecoder exists in exactly this form already.

The engine implements only the uncompressed cases. PcmPacketDecoder is here for the same reason UncompressedVideoCodec is: so the path can be shipped and tested with nothing linked. A WebM with an Opus track is played by handing MatroskaAudioStreamDecoder an adapter over Concentus, which is a dozen lines in the assembly that already references it.

Fields and properties (2)

  • AudioFormat Format

    The rate and channel count it produces.

  • int MaxFramesPerPacket

    The most frames one packet can turn into.

Methods (2)

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

    Decodes a packet.

  • void Reset()

    Throws away any decoder state, because the stream has jumped.

Used by (7)

  • AudioPacketDecoderRegistryVixen.Video
  • IAudioPacketDecoderFactoryVixen.Video
  • MatroskaAudioStreamDecoderVixen.Video
  • OpusAudioPacketDecoderVixen.Video.Codecs
  • OpusAudioPacketDecoderFactoryVixen.Video.Codecs
  • PcmPacketDecoderVixen.Video
  • PcmPacketDecoderFactoryVixen.Video