getCodecFromDeprecated function

TauCodec getCodecFromDeprecated(
  1. Codec codec
)

Get the new API9 TauCodec from the old API6 Codec

Implementation

//@deprecated
TauCodec getCodecFromDeprecated(Codec codec) {
  TauCodec r = DefaultCodec();
  switch (codec) {
    case Codec.defaultCodec:
      r = DefaultCodec();
      break;
    case Codec.aacADTS:
      r = Aac(AudioFormat.adts);
      break;
    case Codec.opusOGG:
      r = Opus(AudioFormat.ogg);
      break;
    case Codec.opusCAF:
      r = Opus(AudioFormat.caf);
      break;
    case Codec.mp3:
      r = Mp3();
      break;
    case Codec.vorbisOGG:
      r = Vorbis(AudioFormat.ogg);
      break;
    case Codec.pcm16:
      r = Pcm(
        AudioFormat.raw,
        depth: Depth.int16,
        endianness: Endianness.littleEndian,
        nbChannels: NbChannels.mono,
        sampleRate: 44100,
      );
      break;
    case Codec.pcm16WAV:
      r = Pcm(
        AudioFormat.wav,
        depth: Depth.int16,
        endianness: Endianness.littleEndian,
        nbChannels: NbChannels.mono,
        sampleRate: 44100,
      );
      break;
    case Codec.pcm16AIFF:
      r = Pcm(
        AudioFormat.aiff,
        depth: Depth.int16,
        endianness: Endianness.littleEndian,
        nbChannels: NbChannels.mono,
        sampleRate: 44100,
      );
      break;
    case Codec.pcm16CAF:
      r = Pcm(
        AudioFormat.caf,
        depth: Depth.int16,
        endianness: Endianness.littleEndian,
        nbChannels: NbChannels.mono,
        sampleRate: 44100,
      );
      break;
    case Codec.flac:
      r = Flac();
      break;
    case Codec.aacMP4:
      r = Aac(AudioFormat.mp4);
      break;
    case Codec.amrNB:
      Amr(AudioFormat.nb);
      break;
    case Codec.amrWB:
      Amr(AudioFormat.wb);
      break;
    case Codec.pcm8:
      r = Pcm(
        AudioFormat.raw,
        depth: Depth.int8,
        endianness: Endianness.littleEndian,
        nbChannels: NbChannels.mono,
        sampleRate: 44100,
      );
      break;
    case Codec.pcmFloat32:
      r = Pcm(
        AudioFormat.raw,
        depth: Depth.flt32,
        endianness: Endianness.littleEndian,
        nbChannels: NbChannels.mono,
        sampleRate: 44100,
      );
      break;
    case Codec.pcmWebM:
      r = Pcm(
        AudioFormat.webm,
        depth: Depth.int16,
        endianness: Endianness.littleEndian,
        nbChannels: NbChannels.mono,
        sampleRate: 44100,
      );
      break;
    case Codec.opusWebM:
      r = Opus(AudioFormat.webm);
      break;
    case Codec.vorbisWebM:
      r = Vorbis(AudioFormat.webm);
      break;
  }
  return r;
}