Coder Social home page Coder Social logo

dotnet-discid's Introduction

.NET bindings for MusicBrainz libdiscid

Build Status Build status NuGet version

About

dotnet-discid provides .NET bindings for the MusicBrainz DiscID library libdiscid. It allows calculating DiscIDs (MusicBrainz and freedb) for Audio CDs. Additionally the library can extract the MCN/UPC/EAN and the ISRCs from disc.

Requirements

  • .NET or Mono
  • libdiscid >= 0.1.0

To utilize all features you will need libdiscid 0.5.0 or later. The libdiscid feature matrix shows which features are available in each version.

Installation

If you are using Visual Studio the easiest way to install and use dotnet-discid is by installing the NuGet package from https://nuget.org/packages/DotNetDiscId/ . The package contains the .NET assembly and the corresponding native DLLs (both 32 and 64 bit). You just have to make sure to set your build configuration to either x86 or x64 instead of AnyCPU.

If you compile the DotNetDiscId.dll yourself and use it in a project make sure you also have the native libdiscid libraries available. Pre-compiled versions of libdiscid for Windows can be downloaded from http://musicbrainz.org/doc/libdiscid . On Windows it is recommended to ship the discid.dll in your project. If you are using Mono on other platforms such as Linux or OSX you can use a system wide installation of libdiscid, e.g. installed using the platform's package manager.

Source and binary releases of dotnet-discid are available at: http://users.musicbrainz.org/~outsidecontext/dotnet-discid/

Usage

In order to use dotnet-discid you have to reference the DotNetDiscId.dll assembly in your project and make sure the native discid library is available (see notes above).

Below is a simple usage example. The dotnet-discid-example project provides a more complete example.

try
{ 
    string device = DiscId.Disc.DefaultDevice;
    using (var disc = DiscId.Disc.Read(device, Features.Mcn | Features.Isrc))
    {
        Console.Out.WriteLine("DiscId         : {0}", disc.Id);
        Console.Out.WriteLine("FreeDB ID      : {0}", disc.FreedbId);
        Console.Out.WriteLine("MCN            : {0}", disc.Mcn);
        Console.Out.WriteLine("First track no.: {0}", disc.FirstTrackNumber);
        Console.Out.WriteLine("Last track no. : {0}", disc.LastTrackNumber);
        Console.Out.WriteLine("Sectors        : {0}", disc.Sectors);
        Console.Out.WriteLine("Submission URL : {0}", disc.SubmissionUrl);
    }
}
catch (DiscIdException ex)
{
    Console.Out.WriteLine("Could not read disc: {0}.", ex.Message);
}

Contribute

The source code for dotnet-discid is available on GitHub.

Please report any issues on the issue tracker.

License

dotnet-discid is released under the GNU Lesser General Public License Version 3. See LICENSE.txt for details.

dotnet-discid's People

Contributors

phw avatar zastai avatar trclst avatar

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.