Skip to content

Instantly share code, notes, and snippets.

@PragTob
Created July 19, 2017 20:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PragTob/0b13314c9980da964409efc28d0be1d3 to your computer and use it in GitHub Desktop.
Save PragTob/0b13314c9980da964409efc28d0be1d3 to your computer and use it in GitHub Desktop.
mp3_byte_size = (byte_size(binary) - 128)
<< _ :: binary-size(mp3_byte_size), id3_tag :: binary >> = binary
<< "TAG",
title :: binary-size(30),
artist :: binary-size(30),
album :: binary-size(30),
year :: binary-size(4),
comment :: binary-size(30),
_rest :: binary >> = id3_tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment