Exemplo n.º 1
0
        internal void Initialize(int channels, int sampleRate, int minimumBitRate, int nominalBitRate, int maximumBitRate)
        {
            Contract.Ensures(_dspState != IntPtr.Zero);
            Contract.Ensures(_block != IntPtr.Zero);

            Result result = SafeNativeMethods.VorbisEncodeInitialize(_info, channels, sampleRate, minimumBitRate,
                                                                     nominalBitRate, maximumBitRate);

            if (result != Result.Ok)
            {
                throw new IOException(string.Format(CultureInfo.CurrentCulture,
                                                    Resources.NativeVorbisEncoderInitializationError, result));
            }

            CompleteInitialization();
        }