private void ProcessFile(string file)
{
if (File.Exists(file))
{
if (decoder.Ready)
{
//btnOpen.Enabled = false;
btnFingerPrint.Enabled = false;
btnRequest.Enabled = false;
Task.Factory.StartNew(() =>
{
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
ChromaContext context = new ChromaContext();
context.Start(decoder.SampleRate, decoder.Channels);
decoder.Decode(context.Consumer, 120);
context.Finish();
stopwatch.Stop();
ProcessFileCallback(context.GetFingerprint(), stopwatch.ElapsedMilliseconds);
});
}
}
}