{"id":23111729,"url":"https://github.com/john32b/cbae","last_synced_at":"2025-08-16T19:30:47.794Z","repository":{"id":49094305,"uuid":"517157638","full_name":"john32b/cbae","owner":"john32b","description":"Cue Bin CD Audio Encoder","archived":false,"fork":false,"pushed_at":"2025-01-08T10:00:48.000Z","size":218,"stargazers_count":21,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-15T13:32:33.924Z","etag":null,"topics":["audio-encoding","cdda","dosbox","tool"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/john32b.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","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":"2022-07-23T20:26:23.000Z","updated_at":"2025-08-10T21:10:14.000Z","dependencies_parsed_at":"2025-01-08T11:18:26.042Z","dependency_job_id":"6b8ff045-6167-491c-8491-957e0f06b9ca","html_url":"https://github.com/john32b/cbae","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"85c1047adaa8ccc0250e829ab634c4c0b275aa68"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/john32b/cbae","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/john32b%2Fcbae","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/john32b%2Fcbae/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/john32b%2Fcbae/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/john32b%2Fcbae/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/john32b","download_url":"https://codeload.github.com/john32b/cbae/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/john32b%2Fcbae/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270762798,"owners_count":24641007,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["audio-encoding","cdda","dosbox","tool"],"created_at":"2024-12-17T02:10:11.776Z","updated_at":"2025-08-16T19:30:47.434Z","avatar_url":"https://github.com/john32b.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## What is it\n**CBAE** (**C**ue **B**in **A**udio **E**ncoder) is a CLI tool that can encode the audio tracks of a CD image with the **cue/bin** format into OPUS, FLAC, VORBIS or MP3. The new CD Image can then be used in software that supports loading `.cue` files with encoded audio tracks (mostly emulators like DosBox).\n\n⭐ **Updated 2023-09** -- Check the [CHANGELOG](#changelog-dna)\n\n**Features**\n- Supports merged `.bin` files, it can extract the audio from those\n- Generates new `.cue` files with correct parameters\n- Fast encoding, tracks are encoded in parallel\n- Display the SHA-1 hash of tracks *(useful for single file .bin files)*\n\t\n### Example\n![CBAE running](media/s1.png)\n\nTake the original release of **\"Quake (1996)\"**, a single CD Image, including ten (**10**) CD-DA Tracks. Here is a size comparison between the raw image and encoded audio .cue/.bin images.\n\n| Audio       | Audio Tracks | Data Tracks | Total Size |\n| ----------- | ------------ | ----------- | ---------- |\n| CD-DA       | 595MB        | 28MB        | **623MB**  |\n| FLAC        | 255MB        | 28MB        | **283MB**  |\n| OPUS 64Kbps | 26MB         | 28MB        | **55MB**   |\n\nThe OPUS codec produces very nice audio quality even at low bitrates. The encoded Quake CD got a reduction down to **9%** of the original raw CD size.\n\n## Installing :truck:\nCBAE is a nodejs script. It is a single file and has no external dependencies other than FFmpeg. You can download the script from here or from npm.\n\n- From [NPM](https://www.npmjs.com/package/cbae)\n```bash\n# Download and install globally\nnpm i cbae --location=global\n# Run\ncbae\n```\n- From github _(if you don't want to use npm)_\n```bash\n# Clone the git to a dir of your choice\ngit clone https://github.com/john32b/cbae --depth 1\n# Run\nnode cbae/bin\n```\n- **OR** For Windows, download the Executable that does not require NodeJS\n\t- ❗ It is outdated. sorry.\n\t- You can find this in the [Releases Tab in Github](https://github.com/john32b/cbae/releases)  \n\n**In Short, you need:**\n- [NodeJS](https://nodejs.org), version 18+\n- [FFmpeg](http://ffmpeg.org/), set on your PATH *(So it can run from anywhere by calling ffmpeg)* \n- Some basic command line knowledge is a plus\n\n\u003e :pencil2: **TIP**: For Windows the easiest way to get FFmpeg on path, is to copy `ffmpeg.exe` in your Windows dir (usually `C:\\Windows`)\n\n## Running :computer:\n\n**Quick Examples**\n```bash\n# Encode all .cue cd images from H:\\DOS\\cdimages into b:\\encoded\\\n# and convert audio tracks to FLAC\ncbae H:/DOS/cdimages/*.cue -o b:/encoded -enc FLAC\n\n# Encode TombRaider2.cue into the current working directory\n# convert audio to Vorbis 128KBPS, using 12 parallel tasks\ncbae TombRaider2.cue -o . -enc VORBIS:128 -p 12\n\n# Print information for all cue files in current dir\ncbae i *.cue\n\n# Encode ONLY the audio tracks, output in the same dir as the\n# input file, name the generated tracks as \"game-01, game-02...\"\ncbae ~/game.cue -o =src -enc MP3:128 -only audio -tname \"game-{no}\"\n```\n\n**For HELP and USAGE** call `cbae -help`\n\n---\n\n### INPUT \n\nA valid .cue file, full path or relative path. Supports multiple inputs. \n- In Linux you can do file globbing,  `/home/janko/iso/**/*.cue`\n- In Windows basic file globbing is supported,  `c:\\games\\cd\\*.cue`\n- For multiple inputs separate with space,  `game1.cue game2.cue ...`\n\n### OUTPUT\n\nA directory where the new folders will be created. Full or relative path. \n- Set with `-o` . e.g. `cbae quake.cue -o /tmp/ ...` -- Will create `/tmp/quake [e]/`\n- Newly created folders come with the postfix `[e]`, for `Encoded` \n- If you give `=src` then the output folder will be created on the base directory of the input .cue file.\n\n---\n\n### ACTION `e` : encode *(default)*\n\nThe main thing, takes .cue files and encodes the audio tracks to a codec of your choice\u003csup\u003e\\*\u003c/sup\u003e (*more later*). Generates a new .cue file and puts all the new files in a new folder under the declared *output*\n- This is the *default action* meaning, you can skip declaring it. e.g. `cbae e input.cue ...` is the same as `cbae input.cue ...`\n- Example : `cbae ~/iso/TR3.cue -o =src -enc VORBIS:96` --\u003e Will encode `TR3.cue` using Vorbis 96kbps and will put everything in `~/iso/TR3 [e]`\n\n### ACTION `i` : info\n\nWith this you can view some information on a .cue/.bin cd image.   \nFilesizes and SHA-1 checksum.\n\n---\n\n### OPTION `-p \u003cinteger\u003e` \n\nSets the maximum number of concurrent encodes that can run. It gets a default value of 3/4 the threads of your system.\n\n\n### OPTION  `-enc \u003cstring\u003e` \n\nSets encoder and bitrate, given in a single parameter in the format `codec:kbps`. Check the [list of supported tags](#list-of-supported-codecs).  \n- e.g. `cbae .... -enc OPUS:80` --\u003e will use OPUS codec at 80KBPS\n- e.g. `cbae .... -enc FLAC` --\u003e will use FLAC. Notice that it doesn't require the `:KBPS` part\n\n### OPTION `-only (audio|data)` \n\nYou can choose to work on either the `audio` or `data` tracks of the CD. This is useful when you want to extract the data track of a merged CD, where you would use *`-only data`*\n\n### OPTION `-sh` \n\nMakes the generated track filenames in the form of `trackXX.ext`. This is useful in some cases, like the winmm CD Audio Emulator _(DxWnd)_, which needs the tracks to be named like that.  \n_e.g. (track01.bin, track02.ogg, track03.ogg ..... )_\n\u003e NOTE: Soon to be deprecated in favor of `-tname`\n\n### OPTION `-tname \u003cstring\u003e` **new** :star:\n\nCustomize the filename of the generated tracks with the use of a template string. Supported tags are:\n\n|tag|whatis|\n|-|-|\n|`{no}` | Track Number |\n|`{cdt}`| CD Title     |\n|`{cda}`| CD Artist    |\n|`{tt}` | Track Title  | \n|`{ta}` | Track Artist |\n\n**Examples** :\n- string : `\"game {cdt} - Track {no}\"` --\u003e filename : `\"game Quake 2 - Track 01\"`\n- string : `\"{no}-{ta}-{tt}\"` --\u003e Filename : `\"01-Sasha-Magnetic North\"`\n\n**Notes:**\n - If a `.cue` file has TITLE tags for each and every track, then the default naming will use them.\n - The Track Artist and CD Artist tags are actually the `PERFORMER` fields in the cue file\n\n---\n\n### List of supported codecs\n\n| Codec ID         | Min Kbps | Max Kbps |\n| ---------------- | -------- | -------- |\n| MP3              | 32       | 320      |\n| MP3V\u003csup\u003e*\u003c/sup\u003e | 44       | 256      |\n| OPUS             | 28       | 500      |\n| VORBIS           | 64       | 500      |\n| FLAC             | -        | -        |\n| RAW              | -        | -        |\n\n\u003csup\u003e*: MP3 is constant bitrate, while MP3V is variable bitrate.\u003c/sup\u003e \n\n\u003e **Notes**: \n\u003e - The `RAW` encoder can be used to split a merged .bin file to individual raw tracks.\n\u003e - Press `CTRL+C` to exit the program at any time.\n\u003e - On multiple file input, if a file fails, cbae will continue to the next file in queue.\n\u003e - If a CD Image does not include any audio tracks then it will NOT be processed at all.\n\n**Realtime speed of converting two CDs with a bunch of audio tracks to FLAC**\n\n![Flac Demo](media/demo_flac.apng) \n\n## Um, what does CBAE do exactly?\nCBAE takes a `.cue/.bin` file combo, copies the data tracks as they are, and uses FFmpeg to encode the audio tracks into separate files. Finally it produces a new `.cue` file and puts everything into a new folder.\n\n![Visual Example](media/s2.png)\n\u003csup\u003ea picture is worth a thousand words\u003c/sup\u003e\n\nA new `.cue` file is generated and it makes the tracks point to the new encoded audio files.\n\n```text\nFILE \"QUAKE 1 (1996) - Track 01.bin\" BINARY\n\tTRACK 01 MODE1/2352\n\tINDEX 01 00:00:00\nFILE \"QUAKE 1 (1996) - Track 02.opus\" OPUS\n\tTRACK 02 AUDIO\n\tINDEX 01 00:00:00\n\t...\n\t...\nFILE \"QUAKE 1 (1996) - Track 11.opus\" OPUS\n\tTRACK 11 AUDIO\n\tINDEX 01 00:00:00\n```\n\n## Software/Emulators that support .cue files with encoded audio files\n\n- **[DosBox-staging](https://github.com/dosbox-staging/dosbox-staging#for-users)** supports {Flac, Opus, Vorbis, Mp3, Wav}\n- **[DosBox-X](https://dosbox-x.com/wiki/DOSBox%E2%80%90X%E2%80%99s-Feature-Highlights)** supports {Flac, Opus, Vorbis, Mp3, Wav}\n- **[Mednafen](https://mednafen.github.io/documentation)** supports : {Vorbis, Flac, Wav} \n- **[PCSX-Redux](https://pcsx-redux.consoledev.net/)** supports anything its linked ffmpeg dependency supports.\n- **[DxWnd](https://sourceforge.net/projects/dxwnd)** uses an audio emulator for CDDA games, supports {Ogg}\n- I'm sure there are more, *(help me expand this list?)*\n\n## CHANGELOG :dna:\n\n### V1.2\n- Added option `-tname`, allows you to customize the Track Filenames using a simple templating system.\n- Cue Parser will read metadata Track Title and Track Artist from the cue file. Default track naming will use those fields if they exist. \n- Aborting an operation with `ctrl+c` will append an `\"aborted\"` string to the output dirname.\n\n### V1.1\n- Added option `-sh`, gives short names to created tracks `(track01.bin, track02.opus, ... etc)`. \n- Creating partial encodes with the `-only` option, will now generate a `.cue` file.\n- Internal code refactor, JS code now uses ECMAscript modules.\n\n### v1.0\n- The `information` action `(i)` will also display the SHA-1 checksum of all the tracks\n- Can selectively work with audio/data tracks, using the `-only` option\n- `RAW` encoder, meaning the audio tracks will not be encoded, they will be copied\n\n### v0.9\n- First version\n\n## MORE :information_source:\n\n### What about CHD ?\nCHD is an entirely different thing and from what I understand CHD can only include lossless audio plus not all programs/emulators support it.\n\n### Wait, what about CDCRUSH ?\nThis older project of mine [CDCRUSH](https://github.com/john32b/cdcrush) has the functionality to encode audio tracks of a CD. But cdcrush is kinda dead now. It tried to do many things at once, and its main feature to highly compress a cd image into cold storage is *(I think)* deprecated by other archivers that allow the archives to be mounted. Perhaps not in the same compression ratios as cdcrush offered, but nonetheless ready to be accessed. Things like **squashFS** and **dwarFS** among others, they provide very good compression ratios, so for me, it makes sense to keep CD images in a compressed format that are ready to be mounted and played.\n\nThen why not update the cdcrush code? I don't like the code, some parts are messy and others bloated, so I thought it would be better to do fresh start using pure JS *(cdcrush was written in Haxe)* while only implementing the useful stuff, which is audio encode a CD. In other words cdcrush is deprecated.\n\n---\nMade by me, **John32B** under the ISC license *(See license.txt)* \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohn32b%2Fcbae","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohn32b%2Fcbae","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohn32b%2Fcbae/lists"}