Pcm constructor

Pcm(
  1. AudioFormat audioFormat, {
  2. required Depth? depth,
  3. required Endianness? endianness,
  4. required NbChannels? nbChannels,
  5. required int? sampleRate,
})

Implementation

/* ctor */ Pcm(
  AudioFormat audioFormat, {
  required this.depth,
  required this.endianness,
  required this.nbChannels,
  required this.sampleRate,
}) {
  this.audioFormat = audioFormat;
  switch (audioFormat) {
    case AudioFormat.wav:
      deprecatedCodec = Codec.pcm16WAV;
      break;
    case AudioFormat.aiff:
      deprecatedCodec = Codec.pcm16AIFF;
      break;
    case AudioFormat.webm:
      deprecatedCodec = Codec.pcmWebM;
      break;
    case AudioFormat.caf:
      deprecatedCodec = Codec.pcm16CAF;
      break;
    case AudioFormat.raw:
      deprecatedCodec = Codec.pcm16;
      break;
    default:
      throw Exception('Bad Audio Format');
  }
}