GithubHelp home page GithubHelp logo

monkeyst / mp3sharp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zanedubya/mp3sharp

0.0 1.0 0.0 3.85 MB

MP3 decoder in managed .NET code.

License: GNU Lesser General Public License v3.0

C# 100.00%

mp3sharp's Introduction

MP3Sharp

Decode MP3 files to PCM bitstreams entirely in .NET managed code:

SETUP

To use MP3Sharp, you will need: an audio device that accepts PCM data, an array of bytes to act as the PCM data buffer (default size is 4096 bytes), and a MP3 file. That's it!

The default interface to MP3Sharp is the MP3Stream class. An instance of MP3Stream takes a filepath to a MP3 file as a parameter and outputs PCM data:

// open the mp3 file.
MP3Stream stream = new MP3Stream(@"sample.mp3");
// Create the buffer.
byte[] buffer = new byte[4096];
// read the entire mp3 file.
int bytesReturned = 1;
int totalBytesRead = 0;
while (bytesReturned > 0)
{
    bytesReturned = stream.Read(buffer, 0, buffer.Length);
    totalBytesRead += bytesReturned;
}
// close the stream after we're done with it.
stream.Close();

So simple!

LICENSE

MP3Sharp is licensed under the LGPL Version 3.

CREDITS

MP3Sharp is a port of JavaLayer, a MP3 decoder written by JavaZoom and released under the LGPL. JavaLayer was initially ported to C# by Robert Burke, in what he modestly describes as a 'half day project'. tekHedd added some significant speed optimizations. I've spent a few weeks of evenings cleaning up the code and reducing redundancies throughout. The sample MP3 file used in this project is by BenSound, and is included under the terms of the Creative Commons - Attribution - No Derivative Works license.

FUTURE IMPROVEMENT

  • Many of the variables throughout the ported code are poorly named. I've done my best to clean them up, but don't know enough about the MP3 specification to suggest better names for most of them.
  • There is a large amount of dead code and variables that are assigned but never used, and thus significant area for improvement of decoding (using these variables properly) or optimization (removing them altogether).

mp3sharp's People

Contributors

jessehallam avatar zanedubya avatar

Watchers

 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.