{"id":26117914,"url":"https://github.com/devidw/11-mp3","last_synced_at":"2025-12-06T20:01:37.851Z","repository":{"id":268154162,"uuid":"903147177","full_name":"devidw/11-mp3","owner":"devidw","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-13T22:35:34.000Z","size":139,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T23:38:16.999Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devidw.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"devidw"}},"created_at":"2024-12-13T22:35:32.000Z","updated_at":"2024-12-13T22:36:42.000Z","dependencies_parsed_at":"2024-12-14T19:12:14.262Z","dependency_job_id":null,"html_url":"https://github.com/devidw/11-mp3","commit_stats":null,"previous_names":["devidw/11-mp3"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devidw%2F11-mp3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devidw%2F11-mp3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devidw%2F11-mp3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devidw%2F11-mp3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devidw","download_url":"https://codeload.github.com/devidw/11-mp3/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242847742,"owners_count":20194967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-10T11:47:35.993Z","updated_at":"2025-12-06T20:01:32.810Z","avatar_url":"https://github.com/devidw.png","language":"TypeScript","readme":"# issue\n\n- bad.json was retrieved from ws tts\n- bad.mp3 is the mp3 file from the base64 encoding (see write.ts)\n- bad.mp3 web playback is fine, however when dealing with the file inside unity\n  for placback and using node av (and mp3) packages for procesing, it fails (see\n  to_wav.ts)\n  ```\n  error: Uncaught (in promise) Error: bad main_data_begin pointer\n      at Layer3.decode (file:///Users/devidw/Library/Caches/deno/npm/registry.npmjs.org/mp3/0.1.0/src/layer3.js:112:19)\n      at MP3Frame.decode (file:///Users/devidw/Library/Caches/deno/npm/registry.npmjs.org/mp3/0.1.0/src/frame.js:31:13)\n      at Class.readChunk (file:///Users/devidw/Library/Caches/deno/npm/registry.npmjs.org/mp3/0.1.0/src/decoder.js:40:19)\n      at Class.Decoder.decode (file:///Users/devidw/Library/Caches/deno/npm/registry.npmjs.org/av/0.4.9/src/decoder.js:72:23)\n      at Class.\u003canonymous\u003e (file:///Users/devidw/Library/Caches/deno/npm/registry.npmjs.org/av/0.4.9/src/decoder.js:46:26)\n      at Class.EventEmitter.emit (file:///Users/devidw/Library/Caches/deno/npm/registry.npmjs.org/av/0.4.9/src/core/events.js:64:12)\n      at Class.readChunk (file:///Users/devidw/Library/Caches/deno/npm/registry.npmjs.org/mp3/0.1.0/src/demuxer.js:168:18)\n      at BufferSource.\u003canonymous\u003e (file:///Users/devidw/Library/Caches/deno/npm/registry.npmjs.org/av/0.4.9/src/demuxer.js:49:19)\n      at BufferSource.EventEmitter.emit (file:///Users/devidw/Library/Caches/deno/npm/registry.npmjs.org/av/0.4.9/src/core/events.js:64:12)\n      at BufferSource.loop (file:///Users/devidw/Library/Caches/deno/npm/registry.npmjs.org/av/0.4.9/src/sources/buffer.js:49:21)\n  ```\n\n## cause?\n\nffmpeg inspection indicates several problems:\n\n```bash\nffmpeg -i bad.mp3 -f null -\n```\n\n\u003e [mp3 @ 0x158e2bcb0] Format mp3 detected only with low score of 25, misdetection possible!\n\n\u003e [mp3 @ 0x158e2bcb0] Skipping 114 bytes of junk at 0.\n\n\u003e [mp3 @ 0x158e2bcb0] Estimating duration from bitrate, this may be inaccurate\n\n## re-encoding\n\nre-rencoding with ffmpeg solves the issues, but is an expensive operation\n\n```bash\nffmpeg -i bad.mp3 -c:a libmp3lame -y fix.mp3\n```\n\n## Qs\n\n- q: elevenlabs should provide valid mp3 output that does not cause the issues\n  demonstrated?\n\n- q (unrelated): why is elevenlabs base64 encoding audio instead of binary transfer via web\n  sockets, which would result in smaller data size thus lower latency\n","funding_links":["https://github.com/sponsors/devidw"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevidw%2F11-mp3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevidw%2F11-mp3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevidw%2F11-mp3/lists"}