ndac_todoroki

ndac_todoroki

ID3 - a mp3 ID3v1/v2 tag reader/writer for Elixir

ID3 tags are a mess :frowning_face:

ID3v1 tags and ID3v2 tags aren’t compatible with each other. ID3v2.1 and ID3v2.4 uses different data structures.

There are a way to read/write ID3v1 tags in pure Elixir/Erlang. You just read the header of the file, using Bitstring. But things were not easy for ID3v2 tags.
Previous projects exists like ID3v2, but it is still just for reading.
I needed a library to write tags, so I can batch download mp3 files using Flow and HTTPoison, and edit metadata.

I tried by forking the library above, but it seemed a lot of work. So instead, I used a Rust library which is named rust-id3.
Thank you Rustler!

https://github.com/ndac-todoroki/elixir-id3

Currently this library supports only the major ID3 frames, like titles, artists, and years. Frames which could contain multiple data such as comments or images are yet to be done. (I am learning Rust as I implement…)

Usage are simple; Reading ID3 tag will be like this.

iex> {:ok, tag} = ID3.get_tag("audio.mp3")
iex> tag
%ID3.Tag{
  album_artist: "Queen",
  artist: "Queen",
  date_recorded: ~N[1977-10-07 00:00:00],
  date_released: ~N[1981-11-02 00:00:00],
  disc: 1,
  duration: nil,
  genre: "Rock",
  title: "We Will Rock You",
  total_discs: 1,
  total_tracks: 17,
  track: 16,
  year: 1981
}

You can edit the Tag struct, and write it back via ID3.write_tag("audio.mp3", new_tag).

This is my first Elixir library (if this is :slight_smile:). Please feel free to tell me what should be done to be better!
I should be able to continue on this project after a month or so. Thanks!

First Post!

malodou1

malodou1

Hey thanks for the library, I just tried it but its not working.

I get this error during compilation.

thread 'main' panicked at 'Erlang version 2.16 not handled, please file a a bug report.',

Where Next?

Popular in Announcing Top

Hal9000
Here is my first stab at this. README pasted below. https://github.com/Hal9000/elixir_random Comments and critiques are welcome. Thank...
New
bryanjos
Hi, I just published version 0.23.0 of Elixirscript. https://github.com/bryanjos/elixirscript/blob/master/CHANGELOG.md Most of the chan...
New
mspanc
I am pleased to announce an initial release of the Membrane Framework - an Elixir-based framework with special focus on processing multim...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 30338 241
New
tmbb
I’ve decided to create this topic to discuss optimization possibilities for something like Phoenix LiveView. I’ve created this topic unde...
144 10789 141
New
kip
ex_cldr provides localisation and internationalisation support based upon the data from the Unicode CLDR project. Unicode released CLDR ...
407 13256 120
New
trisolaran
Hi! :waving_hand: I would like to present LiveSelect, a little library that I wrote to easily add a dynamic selection input to your LV f...
198 11220 107
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement