Example #1
0
 public void TestGetChannelCount()
 {
     Assert.AreEqual(1, AudioUtility.GetChannelCount(AudioMixdown.Mono));
     Assert.AreEqual(2, AudioUtility.GetChannelCount(AudioMixdown.Stereo));
     Assert.AreEqual(6, AudioUtility.GetChannelCount(AudioMixdown.Surround5dot1));
     Assert.AreEqual(8, AudioUtility.GetChannelCount(AudioMixdown.Surround7dot1));
 }
Example #2
0
        protected virtual MappedAudioStream MapAudioStream(FFmpegConfig config,
                                                           AudioStreamInfo sourceStream,
                                                           AudioOutputStream outputStream)
        {
            var result = new MappedAudioStream()
            {
                Input = GetStreamInput(sourceStream),
                Codec = new Codec(GetAudioCodecName(config, outputStream.Format))
            };

            if (outputStream.Mixdown.HasValue)
            {
                result.ChannelCount = AudioUtility.GetChannelCount(outputStream.Mixdown.Value);
            }

            if (outputStream.Quality.HasValue)
            {
                result.Bitrate = $"{outputStream.Quality:0}k";
            }

            return(result);
        }