GithubHelp home page GithubHelp logo

wahwah's Introduction

WahWah

CI Coverage Status Ruby Style Guide

WahWah is an audio metadata reader Ruby gem, it supports many popular formats including mp3(ID3 v1, v2.2, v2.3, v2.4), m4a, ogg, oga, opus, wav, flac and wma.

WahWah is written in pure Ruby, and without any dependencies.

Installation

Add this line to your application's Gemfile:

gem "wahwah"

And then execute:

$ bundle

Or install it yourself as:

$ gem install wahwah

Compatibility

WahWah support Ruby 2.7+

Usage

WahWah is so easy to use.

require "wahwah"

# Get metadata from an audio file

tag = WahWah.open("/files/example.wav")

tag.title       # => "song title"
tag.artist      # => "artist name"
tag.album       # => "album name"
tag.albumartist # => "albumartist name"
tag.composer    # => "composer name"
tag.comments    # => ["comment", "another comment"]
tag.track       # => 1
tag.track_total # => 10
tag.genre       # => "Rock"
tag.year        # => "1984"
tag.disc        # => 1
tag.disc_total  # => 2
tag.lyrics      # => "song lyrics"
tag.duration    # => 256.1 (in seconds)
tag.bitrate     # => 192 (in kbps)
tag.sample_rate # => 44100 (in Hz)
tag.bit_depth   # => 16 (in bits, only for PCM formats)
tag.file_size   # => 976700 (in bytes)
tag.images      # => [{ :type => :cover_front, :mime_type => 'image/jpeg', :data => 'image data binary string' }]


# Get all support formats

WahWah.support_formats # => ["mp3", "ogg", "oga", "opus", "wav", "flac", "wma", "m4a"]

wahwah's People

Contributors

aidewoode avatar dependabot[bot] avatar evilmarty avatar floatplane avatar gogainda avatar obskyr avatar robbevp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wahwah's Issues

M4A files not recognized

I have several albums where no artist/album is recognized by wahwah, but MP4Info does recognize and extract the correct information, so I know it's in there.

MP4Info has several m4a files in its test directory that wahwah doesn't pull all the information for correctly. I'm not very familiar with the m4a format or parsing out atoms and such, but I could write failing tests for those files if that would be helpful.

However, wahwah does seem to pull the artist/album names correctly for those test files where with my files it does not. I could send you a sample file if that would be helpful too.

Support for chapters

I'm looking to use WahWah as part of a Jekyll-based podcast publishing tool, and to that end, it would be mighty helpful if it supported chapters (which are finally – over a decade since their introduction – seeing some adoption among player software).

Ogg's chapters are documented here, and ID3v2's chapters are documented here. There's also reportedly a proprietary chapter encoding used by Apple in their M4A files, but I might argue that supporting that is a secondary or… tertiary or… quaternary priority. (I haven't surveyed how much use they see in the wild, however, so I can't say for entirely certain.)

Thank you ever so much for the wonderful library! 😊 I can't tell you how much of a relief it is to have a library that unifies the API for all these formats successfully!

Add support for AAIF files.

This library does not yet support AAIF files which is another lossless audio codec which stores metadata. Support for this would be very useful.

Add bit depth attribute

It would be great if this library would return the bit depth of the audio file. Since you already use bits_per_sample internally, it wouldn't make a big change to rename this to bit_depth and expose the property. I got this to work locally for both flac and wav.

However, files with lossy compression don't have a bit depth. I'd propose to just leave this nil.
The only encoding I'm unclear on is ASF since WMA can be both lossy and lossless.

It be happy to work on a PR for this, but wanted to check-in first.

Flac files with vorbis tags aren't always recognized

I've noticed a problem with flac files that contain vorbis tags. While they are by a lot of other libraries (ffprobe, EasyTag), they aren't recognized by WahWah (giving a result like <WahWah::FlacTag:0x5000 title= artist= album= albumartist= composer= track= track_total= genre= year= disc= disc_total= duration=933 bitrate=705 sample_rate=44100 bit_depth=16>).

If I reencode the file (without changing any of the tags), it is recognized by wahwah. The files might have slight fault or problems in encoding, but it would be nice to make the library more robust.

I can send a few sample files in private if this would help.

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.