"순수한"오디오와 함께 작동하는 다른 오디오 라이브러리가 있습니까?
예 중 하나가 :
using CSCore;
using CSCore.Codecs;
using CSCore.SoundOut;
using CSCore.Streams;
using System;
using System.Threading;
...
private static void Main(string[] args)
{
const string filename = @"C:\Temp\test.mp3";
EventWaitHandle waitHandle = new AutoResetEvent(false);
try
{
//create a source which provides audio data
using(var source = CodecFactory.Instance.GetCodec(filename))
{
//create the equalizer.
//You can create a custom eq with any bands you want, or you can just use the default 10 band eq.
Equalizer equalizer = Equalizer.Create10BandEqualizer(source);
//create a soundout to play the source
ISoundOut soundOut;
if(WasapiOut.IsSupportedOnCurrentPlatform)
{
soundOut = new WasapiOut();
}
else
{
soundOut = new DirectSoundOut();
}
soundOut.Stopped += (s, e) => waitHandle.Set();
IWaveSource finalSource = equalizer.ToWaveSource(16); //since the equalizer is a samplesource, you have to convert it to a raw wavesource
soundOut.Initialize(finalSource); //initialize the soundOut with the previously created finalSource
soundOut.Play();
/*
* You can change the filter configuration of the equalizer at any time.
*/
equalizer.SampleFilters[0].SetGain(20); //eq set the gain of the first filter to 20dB (if needed, you can set the gain value for each channel of the source individually)
//wait until the playback finished
//of course that is optional
waitHandle.WaitOne();
//remember to dispose and the soundout and the source
soundOut.Dispose();
}
}
catch(NotSupportedException ex)
{
Console.WriteLine("Fileformat not supported: " + ex.Message);
}
catch(Exception ex)
{
Console.WriteLine("Unexpected exception: " + ex.Message);
}
}
당신은 이제까지 당신이 원하는 이퀄라이저를 구성 할 수 있습니다 https://cscore.codeplex.com
EqualizerSample에 따르면, 당신은 그런 이퀄라이저를 사용할 수 있습니다. 또한 실시간으로 100 % 실행되기 때문에 모든 변경 사항이 즉시 적용됩니다. 필요한 경우 각 채널을 개별적으로 수정할 수있는 가능성도 있습니다.
안녕하세요! 오늘 CSCORE를 업데이트했지만 문제가 해결되었지만 또 다른 문제가 발생했습니다. 이제 문제는 이퀄라이저를 사용하는 것이 이전 (이 코드)과 같지 않고 사용 방법을 파악할 수 없다는 것입니다. 제발 나를 도울 수 있니? – ACE