示例#1
0
        public AudioResampler(AudioFormat src, AudioFormat dst)
        {
            Source      = src;
            Destination = dst;

            try {
                ctx = FF.swr_alloc_set_opts(null,
                                            Destination.ChannelLayout, Destination.SampleFormat, Destination.SampleRate,
                                            Source.ChannelLayout, Source.SampleFormat, Source.SampleRate,
                                            0, null);
                Reset();
            } catch {
                Dispose();
                throw;
            }
        }