GithubHelp home page GithubHelp logo

spirosbax / mp3.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juliaaudio/mp3.jl

0.0 1.0 0.0 236 KB

MP3 codec for Julia using JuliaAudio idioms. LAME and mpg123 working under the hood

License: Other

Julia 100.00%

mp3.jl's Introduction

MP3

Build Status Build status codecov.io

MP3 is a Julia library for reading and writing MP3 files.

Usage

The API follows the idioms of FileIO, and uses SampleBuf type to store audio samples. This should supplement LibSndFile which does not support MP3 for patent issues.

Loading MP3

julia> using MP3

julia> audio = load("Sour_Tennessee_Red_Sting.mp3")
245376-frame, 2-channel SampleBuf{FixedPointNumbers.Fixed{Int16,15}, 2, SIUnits.SIQuantity{Int64,0,0,-1,0,0,0,0,0,0}}
5.564081632653061 s at 44100 s⁻¹
▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▆▆▆▇▇▇▇▆▆▅▄▄▄▄▄▄▇▇▇▇▇▆▇▇▇▇▇▆▅▅▄▄▃▃▃▃▃▂▂▂▁▂▁▁▁
▇▇▇▆▇▇▇▆▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▆▆▅▇▇▆▆▆▅▅▄▄▄▅▄▃▇▇▇▇▇▆▇▇▇▇▆▆▅▄▄▄▄▃▃▃▃▂▂▂▁▂▁▁▁

Saving MP3

Various options for encoding MP3 files can be specified using keyword arguments to save() function. An ID3v2 block will be added in front of the file, and the following tags can be optionally given as keyword arguments: title, artist, album, year, comment.

julia> save("mono.mp3", audio; nchannels = 1)           # save as mono audio

julia> save("small.mp3", audio; bitrate = 128)          # set bitrate to 128kbps

julia> save("vbr.mp3", audio; VBR = true, quality = 0)  # encode as highest-quality VBR

julia> save("down.mp3", audio; samplerate = 8kHz)       # downsample to 8 kHz

License

This Julia library is distributed under MIT license. It uses LAME for encoding and mpg123 for decoding mp3, which are dynamically linked, binding to the terms of their LGPL.

mp3.jl's People

Contributors

ssfrr avatar jongwook avatar tkelman avatar staticfloat avatar

Watchers

James Cloos 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.