当前位置: 首页>>代码示例>>C#>>正文


C# IDecoder.Decode方法代码示例

本文整理汇总了C#中IDecoder.Decode方法的典型用法代码示例。如果您正苦于以下问题:C# IDecoder.Decode方法的具体用法?C# IDecoder.Decode怎么用?C# IDecoder.Decode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDecoder的用法示例。


在下文中一共展示了IDecoder.Decode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ComputeSpectrogram

        /// <summary>
        /// Computes the spectogram of an audio file.
        /// </summary>
        /// <param name="decoder">The <see cref="IDecoder"/> instance.</param>
        /// <returns>Chroma image.</returns>
        public static Image ComputeSpectrogram(IDecoder decoder)
        {
            int numBands = 72;

            var image = new Image(numBands);
            var image_builder = new ImageBuilder(image);

            var chroma = new Spectrum(numBands, MIN_FREQ, MAX_FREQ, FRAME_SIZE, SAMPLE_RATE, image_builder);

            var fft = new FFT(FRAME_SIZE, OVERLAP, chroma, new LomontFFTService());
            var processor = new AudioProcessor(SAMPLE_RATE, fft);

            processor.Reset(decoder.SampleRate, decoder.Channels);
            decoder.Decode(processor, 120);
            processor.Flush();

            return image;
        }
开发者ID:wo80,项目名称:AcoustID.NET,代码行数:23,代码来源:ImageGenerator.cs

示例2: ComputeChromagram

        /// <summary>
        /// Computes the chromagram of an audio file.
        /// </summary>
        /// <param name="decoder">The <see cref="IDecoder"/> instance.</param>
        /// <returns>Chroma image.</returns>
        public static Image ComputeChromagram(IDecoder decoder)
        {
            var image = new Image(12);
            var image_builder = new ImageBuilder(image);

            var chroma_normalizer = new ChromaNormalizer(image_builder);
            var chroma_filter = new ChromaFilter(ChromaFilterCoefficients, chroma_normalizer);
            var chroma = new Chroma(MIN_FREQ, MAX_FREQ, FRAME_SIZE, SAMPLE_RATE, chroma_filter);

            var fft = new FFT(FRAME_SIZE, OVERLAP, chroma, new LomontFFTService());
            var processor = new AudioProcessor(SAMPLE_RATE, fft);

            processor.Reset(decoder.SampleRate, decoder.Channels);
            decoder.Decode(processor, 120);
            processor.Flush();

            return image;
        }
开发者ID:wo80,项目名称:AcoustID.NET,代码行数:23,代码来源:ImageGenerator.cs

示例3: Compute

        //static int MAX_FILTER_WIDTH = 20;

        public static Image Compute(string file, IDecoder decoder)
        {
            int numBands = 72;

            Image image = new Image(numBands);
            ImageBuilder image_builder = new ImageBuilder(image);
            Spectrum chroma = new Spectrum(numBands, MIN_FREQ, MAX_FREQ, FRAME_SIZE, SAMPLE_RATE, image_builder);
            FFT fft = new FFT(FRAME_SIZE, OVERLAP, chroma);
            AudioProcessor processor = new AudioProcessor(SAMPLE_RATE, fft);

            processor.Reset(decoder.SampleRate, decoder.Channels);
            decoder.Decode(processor, 120);
            processor.Flush();

            //ExportImage(image, name, 0.5);

            return image;
        }
开发者ID:gaborp,项目名称:AcoustID.NET,代码行数:20,代码来源:Spectrogram.cs

示例4: Compute

        public static Image Compute(string file, IDecoder decoder)
        {
            Image image = new Image(12);
            ImageBuilder image_builder = new ImageBuilder(image);
            ChromaNormalizer chroma_normalizer = new ChromaNormalizer(image_builder);
            ChromaFilter chroma_filter = new ChromaFilter(ChromaFilterCoefficients, chroma_normalizer);
            //Chroma chroma = new Chroma(MIN_FREQ, MAX_FREQ, FRAME_SIZE, SAMPLE_RATE, &chroma_normalizer);
            Chroma chroma = new Chroma(MIN_FREQ, MAX_FREQ, FRAME_SIZE, SAMPLE_RATE, chroma_filter);
            FFT fft = new FFT(FRAME_SIZE, OVERLAP, chroma);
            AudioProcessor processor = new AudioProcessor(SAMPLE_RATE, fft);

            processor.Reset(decoder.SampleRate, decoder.Channels);
            decoder.Decode(processor, 120);
            processor.Flush();

            //ExportImage(image, name);

            return image;
        }
开发者ID:gaborp,项目名称:AcoustID.NET,代码行数:19,代码来源:Chromagram.cs


注:本文中的IDecoder.Decode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。