Beispiel #1
0
 public AudioFormat(int sampleRate, AVChannelLayout channelLayout, AVSampleFormat sampleFormat)
 {
     SampleRate         = sampleRate;
     ChannelLayout      = channelLayout;
     SampleFormat       = sampleFormat;
     BitsPerSample      = GetBytePerSample(sampleFormat) * 8;
     ValidBitsPerSample = SampleFormat.EqualsType(AVSampleFormat.Int32) ? 24 : BitsPerSample;
 }
Beispiel #2
0
 public AudioFormat(int sampleRate, AVChannelLayout channelLayout, AVSampleFormat sampleFormat)
 {
     SampleRate         = sampleRate;
     ChannelLayout      = channelLayout;
     SampleFormat       = sampleFormat;
     Channels           = GetChannels(channelLayout);
     BitsPerSample      = GetBytePerSample(sampleFormat) * 8;
     SampleType         = GetSampleType(sampleFormat);
     IsPlanarFormat     = sampleFormat.IsPlanar();
     LineCount          = IsPlanarFormat ? Channels : 1;
     LineBlock          = IsPlanarFormat ? (BitsPerSample >> 3) : (BitsPerSample >> 3) * Channels;
     ValidBitsPerSample = SampleFormat.EqualsType(AVSampleFormat.Int32) ? 24 : BitsPerSample;
 }