{"action":"created","issue":{"url":"https://api.github.com/repos/bwmarrin/dca/issues/5","repository_url":"https://api.github.com/repos/bwmarrin/dca","labels_url":"https://api.github.com/repos/bwmarrin/dca/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/bwmarrin/dca/issues/5/comments","events_url":"https://api.github.com/repos/bwmarrin/dca/issues/5/events","html_url":"https://github.com/bwmarrin/dca/issues/5","id":136190996,"number":5,"title":"Metadata","user":{"login":"meew0","id":3662915,"avatar_url":"https://avatars.githubusercontent.com/u/3662915?v=3","gravatar_id":"","url":"https://api.github.com/users/meew0","html_url":"https://github.com/meew0","followers_url":"https://api.github.com/users/meew0/followers","following_url":"https://api.github.com/users/meew0/following{/other_user}","gists_url":"https://api.github.com/users/meew0/gists{/gist_id}","starred_url":"https://api.github.com/users/meew0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meew0/subscriptions","organizations_url":"https://api.github.com/users/meew0/orgs","repos_url":"https://api.github.com/users/meew0/repos","events_url":"https://api.github.com/users/meew0/events{/privacy}","received_events_url":"https://api.github.com/users/meew0/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bwmarrin/dca/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2016-02-24T21:26:23Z","updated_at":"2016-02-27T20:09:19Z","closed_at":null,"body":"We've discussed on Discord that DCA files should contain metadata as the first packet - the very first byte will specify the metadata length and the rest of the first packet will contain a JSON of the metadata. Then, starting with the second packet, opus will resume as normal. Here are some metadata fields I propose:\r\n\r\n- `version` - a number that gets incremented every time something changes in the actual DCA file format, starts at `1`\r\n- `rev` - a specifier that determines which revision of dca was used to generate this (for example `bwmarrin/dca#32361ee92fcbd0e404b2be18adf497a45fef4a5f`)\r\n- `tool` - if a separate tool was used to generate this DCA file, this field contains information about what tool and the revision in the same format as `rev`\r\n- `source` - where this DCA file was generated from (`file`, `stdin` or other things in the future)\r\n- `abr` - the audio bitrate in kbit/s\r\n- `url` - if the track was downloaded from somewhere, the URL where it can be found\r\n- `title` _(self-explanatory)_\r\n- `author` _(self-explanatory)_  \r\nFurthermore, the `y-` prefix can be reserved for information copied over from youtube-dl's JSON file, and the `x-` prefix can be reserved for other fields the particular tool/library needs.\r\n\r\n*Added in response to [188480082](https://github.com/bwmarrin/dca/issues/5#issuecomment-188480082) and [189713886](https://github.com/bwmarrin/dca/issues/5#issuecomment-189713886)*:\r\n- `sample_rate` - Opus audio sample rate in kbit/s\r\n- `application` - Opus audio application - `voip`/`music`/`lowdelay`. I chose application over mode because it's more commonly used everywhere else\r\n- `vbr` - Opus variable bitrate setting\r\n- `frame_size` - Opus frame size in bits\r\n- `channels` - Number of audio channels\r\n- `album`/`genre`/`track_num` _(self-explanatory)_  \r\nAs for ffmpeg metadata, maybe an `f-` prefix for those specific fields?\r\n\r\nAll of these are just suggestions and most are probably useless, please suggest others and comment on existing ones!"},"comment":{"url":"https://api.github.com/repos/bwmarrin/dca/issues/comments/189715529","html_url":"https://github.com/bwmarrin/dca/issues/5#issuecomment-189715529","issue_url":"https://api.github.com/repos/bwmarrin/dca/issues/5","id":189715529,"user":{"login":"meew0","id":3662915,"avatar_url":"https://avatars.githubusercontent.com/u/3662915?v=3","gravatar_id":"","url":"https://api.github.com/users/meew0","html_url":"https://github.com/meew0","followers_url":"https://api.github.com/users/meew0/followers","following_url":"https://api.github.com/users/meew0/following{/other_user}","gists_url":"https://api.github.com/users/meew0/gists{/gist_id}","starred_url":"https://api.github.com/users/meew0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meew0/subscriptions","organizations_url":"https://api.github.com/users/meew0/orgs","repos_url":"https://api.github.com/users/meew0/repos","events_url":"https://api.github.com/users/meew0/events{/privacy}","received_events_url":"https://api.github.com/users/meew0/received_events","type":"User","site_admin":false},"created_at":"2016-02-27T20:09:19Z","updated_at":"2016-02-27T20:09:19Z","body":"`DISCORD` or `DISCORDAUDIO` don't really matter because the probability of three random bytes being `DCA` is 256⁻³ = 1/16777216, so negligibly small."}}