The aim of this article is to show an efficient algorithm of signal processing which will allow one to have a competent system of sound fingerprinting and signal recognition. I'll try to come with some explanations of the article's algorithm, and also speak about how it can be implemented using the C# programming language. Additionally, I'll try to cover topics of digital signal processing that are used in the algorithm, thus you'll be able to get a clearer image of the entire system. And as a proof of concept, I'll show you how to develop a simple WPF MVVM application.
|
// Sound Fingerprinting framework
// https://code.google.com/p/soundfingerprinting/
// Code license: GNU General Public License v2
// ciumac.sergiu@gmail.com
using System;
using System.ComponentModel;
using DuplicateTracks.View;
namespace DuplicateTracks.Services
{
/// <summary>
/// Generic view window service
/// </summary>
public class GenericViewWindowService : IGenericViewWindow
{
/// <summary>
/// Lock object
/// </summary>
private static readonly object LockObject = new object();
/// <summary>
/// Actual view (uninitialized)
/// </summary>
private GenericView _view;
/// <summary>
/// Lazy initialization of the view
/// </summary>
/// <returns>Actual view</returns>
private GenericView GetView()
{
lock(LockObject)
{
if (_view != null)
return _view;
_view = new GenericView();
_view.Closed += (sender, e) =>
{
if (Closed != null)
Closed.Invoke(sender, e);
_view = null;
};
_view.Closing += (sender, e) =>
{
if (Closing != null)
Closing.Invoke(sender, e);
};
return _view;
}
}
public bool? DialogResult
{
get { return GetView().DialogResult; }
set { GetView().DialogResult = value; }
}
public object DataContext
{
get { return GetView().DataContext; }
set { GetView().DataContext = value; }
}
public event EventHandler Closed;
public event CancelEventHandler Closing;
public void Show()
{
GetView().Show();
}
public void Close()
{
GetView().Close();
_view = null;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Interested in computer science, math, research, and everything that relates to innovation. Fan of agnostic programming, don't mind developing under any platform/framework if it explores interesting topics. In search of a better programming paradigm.