{"id":13760923,"url":"https://github.com/JayPanoz/audiopkger","last_synced_at":"2025-05-10T11:32:15.081Z","repository":{"id":41735671,"uuid":"233263253","full_name":"JayPanoz/audiopkger","owner":"JayPanoz","description":"A command-line tool to generate and package W3C audiobooks","archived":false,"fork":false,"pushed_at":"2023-11-30T09:50:36.000Z","size":226,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-16T18:34:12.963Z","etag":null,"topics":["audiobooks","cli","digital-publishing","packaging","pub-manifest","publishing"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/JayPanoz.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}},"created_at":"2020-01-11T16:40:59.000Z","updated_at":"2024-07-19T21:03:53.000Z","dependencies_parsed_at":"2023-11-30T10:45:22.205Z","dependency_job_id":null,"html_url":"https://github.com/JayPanoz/audiopkger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JayPanoz%2Faudiopkger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JayPanoz%2Faudiopkger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JayPanoz%2Faudiopkger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JayPanoz%2Faudiopkger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JayPanoz","download_url":"https://codeload.github.com/JayPanoz/audiopkger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253410745,"owners_count":21904130,"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":["audiobooks","cli","digital-publishing","packaging","pub-manifest","publishing"],"created_at":"2024-08-03T13:01:27.581Z","updated_at":"2025-05-10T11:32:14.847Z","avatar_url":"https://github.com/JayPanoz.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# audiopkger\n\nA command-line tool to generate and package W3C audiobooks\n\n## Important Note\n\nThis is a work in progress and is not production-ready. Expect code to change and new dependencies to be added often – creating errors if you didn’t install them or re-install the project.\n\nIf you encounter bugs, please feel free to file an issue or – even better – a pull request.\n\nIf you’ve been using a version \u003c 0.18.0, please reinstall using `npm ci` as upgraded and new dependencies are required.\n\n## Abstract\n\nThis is a small utility you can use in your terminal to generate [W3C audiobooks](https://www.w3.org/TR/audiobooks/). It helps you create a publication manifest, a table of contents (if required), and package your folder into [an `.lpf` archive](https://www.w3.org/TR/lpf/).\n\nNote this utility only works with simple audiobooks. It doesn’t support:\n\n- alternate formats and content (e.g. Synchronized Narration or text);\n- media fragments (a.k.a. references to locations in a single audio track);\n- language and base direction.\n\nHowever, it can still be used to create a starting point in those cases: it will generate files you can edit and augment.\n\n## Install\n\nFirst make sure you have nodeJS and npm installed. If you don’t, [install it](https://nodejs.org/).\n\nIf you don’t want to fork and/or clone the repository and have easier access to its source code then:\n\n```\nnpm install -g git+https://git@github.com/JayPanoz/audiopkger.git\n```\n\n[Forking](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) and/or cloning the repo will make it easier to edit code, add new scripts and formats, etc. since the global command will be tied to your local copy, and you will be able to directly run the command with those changes.\n\nIf you are forking it, you will have to clone yours:\n\n```\ngit clone https://github.com/YourUsername/audiopkger.git\n```\n\nOtherwise: \n\n```\ngit clone https://github.com/JayPanoz/audiopkger.git\n```\n\nThen:\n\n```\ncd path/to/the/cloned-repo\n```\n\nFinally run:\n\n```\nnpm install -g\n```\n\nIf for some reason the `audiopkger` command doesn’t work after the install, run `npm link` from the root of the cloned repository.\n\nTo keep your fork in sync, you can also do:\n\n```\ngit remote add upstream https://github.com/JayPanoz/audiopkger.git\n```\n\nThen you’ll be able to [fetch and merge changes](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork) made in this upstream repo.\n\n## Usage\n\nPlease make sure you are running those commands from the root directory of your audiobook.\n\n```\ncd path/to/your/audiobook-directory\n```\n\nIndeed, the utility will look for the files and subfolders within this directory to create the `readingOrder`, list of `resources`, and table of contents.\n\n### Generate a Manifest and a Table of Contents\n\nRun the following command:\n\n```\naudiopkger init\n```\n\nThis will launch an interactive interface asking you questions to populate the audiobook’s manifest. More precisely, it will ask for:\n\n1. the title of the book;\n2. its address;\n3. its canonical identifier (address, ISBN, or autogenerated UUID);\n4. its author (accepts multiple, delimited with commas or semicolons);\n5. its narrator (accepts multiple, delimited with commas or semicolons);\n6. its publisher (accepts multiple, delimited with commas or semicolons);\n7. its language;\n8. its publication date;\n9. its cover;\n10. its table of contents;\n11. its internal preview;\n12. its supplemental content(s).\n\nWhen a text input is left blank, it will simply not appear in the manifest.\n\nThen it will search for audio files in the directory and list them in the manifest (`readingOrder`). Please make sure their filenames are in the correct order.\n\nThe script will search for a title and duration in the audio files’ metadata to populate their `name` and `duration`. In case it doesn’t find a title, a pattern `Track + file-index` is used as a fallback.\n\nIf you don’t have a table of contents, you can tell the utility to create one from the `readingOrder` automatically, although you will have to edit the entries of the navigation list. This will create a Primary Entry Page (`index.html`) with the table of contents – and table of supplements if any –, and add it in the root directory.\n\nOnce completed, a `publication.json` file will be added in the root directory.\n\n### Generate or Update a Table of Contents\n\nIf you did not create a Primary Entry Page (`index.html`) on `init`, or want to update it after editing `publication.json`, you can run:\n\n```\naudiopkger toc\n```\n\nNote this script expects the manifest to be named `publication.json`, and will error if it isn’t.\n\nThis will create `index.html` in the root directory, and update the manifest (`publication.json`), adding it to the list of `resources` if it was not already present.\n\n### Package\n\nThe `init` command doesn’t automatically package the audiobook. Indeed, you may have to edit the manifest and table of contents beforehand.\n\nTo package, run the following command: \n\n```\naudiopkger package\n```\n\nNote this script expects the manifest to be named `publication.json`, and will error if it isn’t.\n\nIt will then check the manifest and package resources into an `.lpf` archive – with audio files using `STORE`. This consequently shouldn’t package dot files if you’re using a Mac for instance.\n\nThis means you can also use this command as a quick and simple packager for W3C audiobooks if you already have everything required.\n\nIf you want to modify the bitrate of packaged audio, you can run:\n\n```\naudiopkger package -b \u003cnumber\u003e\n```\n\nMake sure you have [FFMPEG installed](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/wiki) before running this command or else it will obviously fail.\n\nThis process may take a while depending on the size of your audiobook, but it won’t overwrite your audio files.\n\nNote Audiopkger doesn’t attempt to check the bitrate of the source audio files, it will blindly follow your instructions.\n\nIf you want something more verbose when using this bitrate option, and log FFMPEG’s progress when processing your audio files, you can run:\n\n```\naudiopkger package -b \u003cnumber\u003e -d\n```\n\nQuick tip: rename the `.lpf` extension to `.zip` to easily unzip this package if needed. If you’re using Visual Studio Code, you could also install [this extension](https://github.com/JayPanoz/vscode-zipexplorer).\n\n### Misc\n\nTo print the help, run:\n\n```\naudiopkger -h\n```\n\nTo check the version, run:\n\n```\naudiopkger -v\n```\n\n## Help\n\n```\naudiopkger [command]\n\n  help ............... show help menu\n  init ............... create an audiobook manifest (and toc) in the directory\n  package ............ package the directory as .lpf\n    --bitrate, -b ......... use FFMPEG to modify the bitrate of packaged audio\n    --details, -d ......... log progression of FFMPEG processing\n  toc ................ create a Table of Contents from the manifest\n  version ............ show the version\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJayPanoz%2Faudiopkger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJayPanoz%2Faudiopkger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJayPanoz%2Faudiopkger/lists"}