本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}