{"id":19435785,"url":"https://github.com/dbushell/audio-duration","last_synced_at":"2025-04-24T21:30:42.547Z","repository":{"id":146433130,"uuid":"612615992","full_name":"dbushell/audio-duration","owner":"dbushell","description":"🔊 Deno native audio duration for MP3 / M4A / M4B (no dependencies)","archived":false,"fork":false,"pushed_at":"2024-07-26T06:22:56.000Z","size":19,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-07-26T07:42:09.666Z","etag":null,"topics":["deno","javascript","typescript"],"latest_commit_sha":null,"homepage":"https://jsr.io/@dbushell/audio-duration","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbushell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-03-11T13:33:16.000Z","updated_at":"2024-07-26T07:42:13.290Z","dependencies_parsed_at":"2024-02-15T12:23:31.147Z","dependency_job_id":"5374efb4-e655-4b7a-bf37-70dc7ef0fd84","html_url":"https://github.com/dbushell/audio-duration","commit_stats":null,"previous_names":["dbushell/audio-duration"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbushell%2Faudio-duration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbushell%2Faudio-duration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbushell%2Faudio-duration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbushell%2Faudio-duration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbushell","download_url":"https://codeload.github.com/dbushell/audio-duration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223968376,"owners_count":17233445,"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":["deno","javascript","typescript"],"created_at":"2024-11-10T15:07:58.572Z","updated_at":"2024-11-10T15:07:59.191Z","avatar_url":"https://github.com/dbushell.png","language":"TypeScript","readme":"# 🔊 Deno Audio Duration\n\nGet the **millisecond** duration of audio files in pure **Deno** flavoured JavaScript. Currently MP3 / M4A / M4B formats are supported.\n\n[![JSR](https://jsr.io/badges/@dbushell/audio-duration?labelColor=98e6c8)](https://jsr.io/@dbushell/audio-duration) [![JSR Score](https://jsr.io/badges/@dbushell/audio-duration/score?labelColor=98e6c8)](https://jsr.io/@dbushell/audio-duration) [![JSR](https://jsr.io/badges/@dbushell?labelColor=98e6c8)](https://jsr.io/@dbushell)\n\n## Usage\n\n```javascript\nimport {duration} from 'jsr:@dbushell/audio-duration';\n\nconst ms = await duration('/path/to/audio.mp3');\n```\n\nThe `duration` function will detect audio formats based on the file extension. Import and use `mp3Duration` and `m4aDuration` to bypass this detection.\n\n## Other Solutions\n\nIf this module is insufficient use another tool with `Deno.Command`:\n\nWith [ffprobe](https://ffmpeg.org/ffprobe.html):\n\n```sh\nffprobe -loglevel quiet -show_format -print_format json audio.mp3\n```\n\nWith [exiftool](https://exiftool.org/):\n\n```sh\nexiftool -j -Duration audio.mp3\n```\n\nFor example:\n\n```typescript\nconst stat = await Deno.stat(entry.path);\nconst command = new Deno.Command('exiftool', {\n  args: ['-j', '-Duration', `${entry.path}`]\n});\nconst {stdout} = await command.output();\nconst json = JSON.parse(\n  new TextDecoder().decode(stdout)\n);\n```\n\nYou'll need to parse the output.\n\n* * *\n\n[MIT License](/LICENSE) | Copyright © 2024 [David Bushell](https://dbushell.com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbushell%2Faudio-duration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbushell%2Faudio-duration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbushell%2Faudio-duration/lists"}