コード例 #1
0
        private static CodecSettings GetEncoderSettings(Codec codec, AudioQuality quality, FrameSize frameSize)
        {
            switch (codec)
            {
            case Codec.Identity:
                return(new CodecSettings(Codec.Identity, 441, 44100));

            //ncrunch: no coverage start (Justification: We don't want to load the opus binaries into a testing context)
            case Codec.Opus:
                return(new CodecSettings(Codec.Opus, (uint)OpusEncoder.GetFrameSize(frameSize), OpusEncoder.FixedSampleRate));

            //ncrunch: no coverage end

            default:
                throw Log.CreatePossibleBugException(string.Format("Unknown Codec {0}", codec), "6232F4FA-6993-49F9-AA79-2DBCF982FD8C");
            }
        }