GithubHelp home page GithubHelp logo

addictedcs / soundfingerprinting.sql Goto Github PK

View Code? Open in Web Editor NEW
7.0 5.0 10.0 21.79 MB

MSSQL data access layer for Sound Fingerprinting algorithm

License: Other

PowerShell 0.93% C# 98.71% Batchfile 0.35%

soundfingerprinting.sql's Introduction

Sound Fingerprinting MSSQL

soundfingerprinting.sql persistent storage implementation which allows storing soundfingerprinting algorithm's data objects in MSSQL database.

Usage

The MSSQL database initialization script can be find here. Do not forget to add connection string FingerprintConnectionString in your app.config filex

<connectionStrings>
    <add name="FingerprintConnectionString" connectionString="Data Source=(local);Initial Catalog=FingerprintsDb;Integrated Security=True; Connection Timeout=15;" providerName="System.Data.SqlClient"/>
</connectionStrings>

Use SqlModelService class when fingerprinting and querying

private readonly IModelService modelService = new SqlModelService(); // SQL back end
private readonly IAudioService audioService = new NAudioService(); // use NAudio audio processing library
private readonly IFingerprintCommandBuilder fingerprintCommandBuilder = new FingerprintCommandBuilder();

public void StoreAudioFileFingerprintsInStorageForLaterRetrieval(string pathToAudioFile)
{
    TrackData track = new TrackData("GBBKS1200164", "Adele", "Skyfall", "Skyfall", 2012, 290);
	
    // store track metadata in the database
    var trackReference = modelService.InsertTrack(track);

    // create sub-fingerprints and its hash representation
    var hashedFingerprints = fingerprintCommandBuilder
                                .BuildFingerprintCommand()
                                .From(pathToAudioFile)
                                .UsingServices(audioService)
                                .Hash()
                                .Result;
								
    // store sub-fingerprints and its hash representation in the database 
    modelService.InsertHashedFingerprintsForTrack(hashedFingerprints, trackReference); // insert in SQL backend
}

Binaries

git clone [email protected]:AddictedCS/soundfingerprinting.sql.git

In order to build latest version of the SoundFingerprinting.SQL assembly run the following command from repository root .\build.cmd

Get it on NuGet

Install-Package SoundFingerprinting.SQL

Contribute

If you want to contribute you are welcome to open issues or discuss on issues page. Feel free to contact me for any remarks, ideas, bug reports etc.

Licence

The framework is provided under MIT licence agreement.

soundfingerprinting.sql's People

Contributors

addictedcs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

soundfingerprinting.sql's Issues

Missing SQL Parameter

When I try to test the app using MS SQL persistent storage I get the following error.
Procedure or function 'sp_InsertTrack' expects parameter '@TrackLengthSec', which was not supplied.

An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll

Downloaded from Nuget packages

The error

Additional information: Procedure or function 'sp_InsertTrack' expects parameter '@TrackLengthSec', which was not supplied.

Here my entire code that gives the error

List<string> lstMp3Files = new List<string> {
                @"D:\15_muzikler\00 UK Top 40 Singles Charts\UK Top 40 Singles Chart 2017-01-21\Clean Bandit - Rockabye ft. Sean Paul & Anne-Marie [Official Video].mp3",
                @"D:\15_muzikler\00 UK Top 40 Singles Charts\UK Top 40 Singles Chart 2017-01-21\JP Cooper - September Song.mp3",
                @"C:\Clean Bandit - Rockabye ft. Sean Paul & Anne-Marie [Official Video].mp3"
            };

            int irLoop = 1;

            foreach (var item in lstMp3Files)
            {
                var track1 = new TrackData("track" + irLoop, "track" + irLoop, "track" + irLoop, "track" + irLoop, 2017, 215);
                // store track metadata in the datasource
                var trackReference = modelService.InsertTrack(track1);

                // create hashed fingerprints
                var hashedFingerprints = fingerprintCommandBuilder
                                            .BuildFingerprintCommand()
                                            .From(item)
                                            .UsingServices(audioService)
                                            .Hash()
                                            .Result;

                // store hashes in the database for later retrieval
                modelService.InsertHashDataForTrack(hashedFingerprints, trackReference);
                irLoop++;
            }

Getting System.InvalidCastException in model binder

Hi,

I'm getting System.InvalidCastException in Modelbinder.cs.

I hve ran DBScript.sql and it created 3 tables.

Can anyone please help.

Exeception redirected to
public TModel BindReader(IReader reader, Func<TModel> modelFactory) { TModel model = modelFactory(); readerAction(reader, model); return model; }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.