Skip to content

Instantly share code, notes, and snippets.

@stolen
Created January 9, 2016 13:57
Show Gist options
  • Save stolen/32079e2910b19ad6ebf8 to your computer and use it in GitHub Desktop.
Save stolen/32079e2910b19ad6ebf8 to your computer and use it in GitHub Desktop.
-module(cue_parse).
-export([parse_md/1]).
parse_md(<<CatNumber:128/binary, LeadInNum:64/integer, IsCD:1, 0:2071, TrackNum:8, Rest/binary>>) ->
Metadate = #{cat_number => CatNumber, lead_in => LeadInNum, is_cd => (IsCD == 1), tracks => TrackNum},
{ok, Metadate, Rest};
parse_md(<<_/binary>>) ->
{error, not_enough_data}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment