Click here to Skip to main content
15,881,588 members
Articles / Desktop Programming / WPF

Duplicate songs detector via audio fingerprinting

Rate me:
Please Sign up or sign in to vote.
4.96/5 (337 votes)
23 Jun 2020MIT44 min read 1.3M   20.4K   533  
Explains sound fingerprinting algorithm, with a practical example of detecting duplicate files on the user's local drive.
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.
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.235
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Soundfingerprinting.SoundTools.Properties {
    using System;
    
    
    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    public class Resources {
        
        private static global::System.Resources.ResourceManager resourceMan;
        
        private static global::System.Globalization.CultureInfo resourceCulture;
        
        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Resources() {
        }
        
        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        public static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Soundfingerprinting.SoundTools.Properties.Resources", typeof(Resources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }
        
        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        public static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Connection string cannot be null or empty!.
        /// </summary>
        public static string ConnectionStringEmpty {
            get {
                return ResourceManager.GetString("ConnectionStringEmpty", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Could not find SoundFingerprintingLib assembly!.
        /// </summary>
        public static string CouldNotFindSoundLibError {
            get {
                return ResourceManager.GetString("CouldNotFindSoundLibError", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to End!.
        /// </summary>
        public static string End {
            get {
                return ResourceManager.GetString("End", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Ensembling ended!.
        /// </summary>
        public static string EnsemblingEnded {
            get {
                return ResourceManager.GetString("EnsemblingEnded", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Error!.
        /// </summary>
        public static string Error {
            get {
                return ResourceManager.GetString("Error", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Select path to file to be analyzed!.
        /// </summary>
        public static string ErrorNoFileToAnalyze {
            get {
                return ResourceManager.GetString("ErrorNoFileToAnalyze", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Exception in DAL!.
        /// </summary>
        public static string ExceptioInDal {
            get {
                return ResourceManager.GetString("ExceptioInDal", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to (*.xml)|*.xml.
        /// </summary>
        public static string ExportFilter {
            get {
                return ResourceManager.GetString("ExportFilter", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to File converted!.
        /// </summary>
        public static string FileConverted {
            get {
                return ResourceManager.GetString("FileConverted", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to (*.csv)|*.csv.
        /// </summary>
        public static string FileFilterCSV {
            get {
                return ResourceManager.GetString("FileFilterCSV", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Ensemble (*.ens)|*.ens.
        /// </summary>
        public static string FileFilterEnsemble {
            get {
                return ResourceManager.GetString("FileFilterEnsemble", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to JPEG File Interchange Format (*.jpg)|*.jpg.
        /// </summary>
        public static string FileFilterJPeg {
            get {
                return ResourceManager.GetString("FileFilterJPeg", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to (*.mp3)|*.mp3.
        /// </summary>
        public static string FileFilterMp3 {
            get {
                return ResourceManager.GetString("FileFilterMp3", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to (*.wav)|*.wav.
        /// </summary>
        public static string FileFilterWav {
            get {
                return ResourceManager.GetString("FileFilterWav", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to File list is empty. No files to be inserted to the database!.
        /// </summary>
        public static string FileListEmpty {
            get {
                return ResourceManager.GetString("FileListEmpty", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Empty file list!.
        /// </summary>
        public static string FileListEmptyCaption {
            get {
                return ResourceManager.GetString("FileListEmptyCaption", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Writing in this folder is prohibited! Please select another path!.
        /// </summary>
        public static string FileWriteDenial {
            get {
                return ResourceManager.GetString("FileWriteDenial", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Finished.
        /// </summary>
        public static string Finished {
            get {
                return ResourceManager.GetString("Finished", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Hash Bins inserted!.
        /// </summary>
        public static string HashBinsInserted {
            get {
                return ResourceManager.GetString("HashBinsInserted", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Image decomposed successfully!.
        /// </summary>
        public static string ImageDecomposedSuccessfuly {
            get {
                return ResourceManager.GetString("ImageDecomposedSuccessfuly", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to The image was drawn!.
        /// </summary>
        public static string ImageIsDrawn {
            get {
                return ResourceManager.GetString("ImageIsDrawn", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Insertion ended!.
        /// </summary>
        public static string InsertionEnded {
            get {
                return ResourceManager.GetString("InsertionEnded", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to 
        ///.
        /// </summary>
        public static string LineFeed {
            get {
                return ResourceManager.GetString("LineFeed", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to (*.mp3)|*.mp3|(*.wav)|*.wav|(*.flac)|*.flac.
        /// </summary>
        public static string MusicFilter {
            get {
                return ResourceManager.GetString("MusicFilter", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to .ntwrk.
        /// </summary>
        public static string NetworkExtension {
            get {
                return ResourceManager.GetString("NetworkExtension", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to No such file!.
        /// </summary>
        public static string NoSuchFile {
            get {
                return ResourceManager.GetString("NoSuchFile", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Permutations.
        /// </summary>
        public static string Permutations {
            get {
                return ResourceManager.GetString("Permutations", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Permutations generation successfully ended!.
        /// </summary>
        public static string PermutationsGenerated {
            get {
                return ResourceManager.GetString("PermutationsGenerated", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Recognition ended!.
        /// </summary>
        public static string RecognitionEnded {
            get {
                return ResourceManager.GetString("RecognitionEnded", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Recognition ended with an error!.
        /// </summary>
        public static string RecognitionEndedWithAnError {
            get {
                return ResourceManager.GetString("RecognitionEndedWithAnError", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Select path to file to be drawn!.
        /// </summary>
        public static string SelectAPathToBeDrawn {
            get {
                return ResourceManager.GetString("SelectAPathToBeDrawn", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Select file!.
        /// </summary>
        public static string SelectFile {
            get {
                return ResourceManager.GetString("SelectFile", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Please select a folder with songs to be queried!.
        /// </summary>
        public static string SelectFolderWithSongs {
            get {
                return ResourceManager.GetString("SelectFolderWithSongs", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Select path to file to dump into!.
        /// </summary>
        public static string SelectPathToDump {
            get {
                return ResourceManager.GetString("SelectPathToDump", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Select path to serialized ensemble.
        /// </summary>
        public static string SelectPathToSerializedEnsemble {
            get {
                return ResourceManager.GetString("SelectPathToSerializedEnsemble", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Select Connection String to Validation database!.
        /// </summary>
        public static string SelectValidationDB {
            get {
                return ResourceManager.GetString("SelectValidationDB", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Songs.
        /// </summary>
        public static string Songs {
            get {
                return ResourceManager.GetString("Songs", resourceCulture);
            }
        }
        
        public static System.Drawing.Icon Sound {
            get {
                object obj = ResourceManager.GetObject("Sound", resourceCulture);
                return ((System.Drawing.Icon)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Please specify the path to network ensemble!.
        /// </summary>
        public static string SpecifyPathToNetworkEnsemble {
            get {
                return ResourceManager.GetString("SpecifyPathToNetworkEnsemble", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Success.
        /// </summary>
        public static string Success {
            get {
                return ResourceManager.GetString("Success", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Text files (*.txt)|*.txt.
        /// </summary>
        public static string TextFiles {
            get {
                return ResourceManager.GetString("TextFiles", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Training finished!.
        /// </summary>
        public static string TrainingFinished {
            get {
                return ResourceManager.GetString("TrainingFinished", resourceCulture);
            }
        }
    }
}

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.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Software Developer
Moldova (Republic of) Moldova (Republic of)
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.

Comments and Discussions