
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
CBAE (Cue Bin Audio Encoder) 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).
⭐ Updated 2023-09 -- Check the CHANGELOG
Features
.bin files, it can extract the audio from those.cue files with correct parameters
Take 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.
| Audio | Audio Tracks | Data Tracks | Total Size |
|---|---|---|---|
| CD-DA | 595MB | 28MB | 623MB |
| FLAC | 255MB | 28MB | 283MB |
| OPUS 64Kbps | 26MB | 28MB | 55MB |
The 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.
CBAE 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.
# Download and install globally
npm i cbae --location=global
# Run
cbae
# Clone the git to a dir of your choice
git clone https://github.com/john32b/cbae --depth 1
# Run
node cbae/bin
In Short, you need:
:pencil2: TIP: For Windows the easiest way to get FFmpeg on path, is to copy
ffmpeg.exein your Windows dir (usuallyC:\Windows)
Quick Examples
# Encode all .cue cd images from H:\DOS\cdimages into b:\encoded\
# and convert audio tracks to FLAC
cbae H:/DOS/cdimages/*.cue -o b:/encoded -enc FLAC
# Encode TombRaider2.cue into the current working directory
# convert audio to Vorbis 128KBPS, using 12 parallel tasks
cbae TombRaider2.cue -o . -enc VORBIS:128 -p 12
# Print information for all cue files in current dir
cbae i *.cue
# Encode ONLY the audio tracks, output in the same dir as the
# input file, name the generated tracks as "game-01, game-02..."
cbae ~/game.cue -o =src -enc MP3:128 -only audio -tname "game-{no}"
For HELP and USAGE call cbae -help
A valid .cue file, full path or relative path. Supports multiple inputs.
/home/janko/iso/**/*.cuec:\games\cd\*.cuegame1.cue game2.cue ...A directory where the new folders will be created. Full or relative path.
-o . e.g. cbae quake.cue -o /tmp/ ... -- Will create /tmp/quake [e]/[e], for Encoded=src then the output folder will be created on the base directory of the input .cue file.e : encode (default)The main thing, takes .cue files and encodes the audio tracks to a codec of your choice* (more later). Generates a new .cue file and puts all the new files in a new folder under the declared output
cbae e input.cue ... is the same as cbae input.cue ...cbae ~/iso/TR3.cue -o =src -enc VORBIS:96 --> Will encode TR3.cue using Vorbis 96kbps and will put everything in ~/iso/TR3 [e]i : infoWith this you can view some information on a .cue/.bin cd image.
Filesizes and SHA-1 checksum.
-p <integer>Sets the maximum number of concurrent encodes that can run. It gets a default value of 3/4 the threads of your system.
-enc <string>Sets encoder and bitrate, given in a single parameter in the format codec:kbps. Check the list of supported tags.
cbae .... -enc OPUS:80 --> will use OPUS codec at 80KBPScbae .... -enc FLAC --> will use FLAC. Notice that it doesn't require the :KBPS part-only (audio|data)You 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
-shMakes 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.
e.g. (track01.bin, track02.ogg, track03.ogg ..... )
NOTE: Soon to be deprecated in favor of
-tname
-tname <string> new :star:Customize the filename of the generated tracks with the use of a template string. Supported tags are:
| tag | whatis |
|---|---|
{no} | Track Number |
{cdt} | CD Title |
{cda} | CD Artist |
{tt} | Track Title |
{ta} | Track Artist |
Examples :
"game {cdt} - Track {no}" --> filename : "game Quake 2 - Track 01""{no}-{ta}-{tt}" --> Filename : "01-Sasha-Magnetic North"Notes:
.cue file has TITLE tags for each and every track, then the default naming will use them.PERFORMER fields in the cue file| Codec ID | Min Kbps | Max Kbps |
|---|---|---|
| MP3 | 32 | 320 |
| MP3V* | 44 | 256 |
| OPUS | 28 | 500 |
| VORBIS | 64 | 500 |
| FLAC | - | - |
| RAW | - | - |
*: MP3 is constant bitrate, while MP3V is variable bitrate.
Notes:
- The
RAWencoder can be used to split a merged .bin file to individual raw tracks.- Press
CTRL+Cto exit the program at any time.- On multiple file input, if a file fails, cbae will continue to the next file in queue.
- If a CD Image does not include any audio tracks then it will NOT be processed at all.
Realtime speed of converting two CDs with a bunch of audio tracks to FLAC
CBAE 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.
a picture is worth a thousand words
A new .cue file is generated and it makes the tracks point to the new encoded audio files.
FILE "QUAKE 1 (1996) - Track 01.bin" BINARY
TRACK 01 MODE1/2352
INDEX 01 00:00:00
FILE "QUAKE 1 (1996) - Track 02.opus" OPUS
TRACK 02 AUDIO
INDEX 01 00:00:00
...
...
FILE "QUAKE 1 (1996) - Track 11.opus" OPUS
TRACK 11 AUDIO
INDEX 01 00:00:00
-tname, allows you to customize the Track Filenames using a simple templating system.ctrl+c will append an "aborted" string to the output dirname.-sh, gives short names to created tracks (track01.bin, track02.opus, ... etc).-only option, will now generate a .cue file.information action (i) will also display the SHA-1 checksum of all the tracks-only optionRAW encoder, meaning the audio tracks will not be encoded, they will be copiedCHD is an entirely different thing and from what I understand CHD can only include lossless audio plus not all programs/emulators support it.
This older project of mine 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.
Then 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.
Made by me, John32B under the ISC license (See license.txt)
FAQs
Cue Bin CD Audio Encoder
The npm package cbae receives a total of 12 weekly downloads. As such, cbae popularity was classified as not popular.
We found that cbae demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.