Пример #1
0
        private static int GetApproxBitRate(EncodeSetup encodeSetup, int channels)
        {
            var template = encodeSetup.Template;

            var setting = (int)encodeSetup.BaseSetting;
            var ds      = encodeSetup.BaseSetting - setting;

            if (template.SampleRateMapping == null)
            {
                return(-1);
            }

            return((int)((template.SampleRateMapping[setting] * (1 - ds)
                          + template.SampleRateMapping[setting + 1] * ds)
                         * channels));
        }
Пример #2
0
        private static EncodeSetup GetEncodeSetup(
            int channels,
            int sampleRate,
            float quality)
        {
            quality += .0000001f;
            if (quality >= 1)
            {
                quality = .9999f;
            }

            return(EncodeSetup.GetBestMatch(
                       channels,
                       sampleRate,
                       quality));
        }
Пример #3
0
 public CodecSetup(EncodeSetup encodeSetup)
 {
     EncodeSetup = encodeSetup;
 }