Skip to content

Instantly share code, notes, and snippets.

@amiroff
Last active July 11, 2024 13:23
Show Gist options
  • Save amiroff/4cd77771f1a1d86f1b248782741ae4aa to your computer and use it in GitHub Desktop.
Save amiroff/4cd77771f1a1d86f1b248782741ae4aa to your computer and use it in GitHub Desktop.
Extracting CHD images with command line (mac, linux)

I use the following flow to convert NeoGeo CD games from CHD format into Wii NeoCDRX compatible extracted format.

Convert .chd file into .cue & .bin

chdman extractcd -i Filename.chd -o output.cue -ob output.bin

Extract all tracks from .bin file -> creates one .iso file and many .wav files

bchunk -w output.bin output.cue Track

Mount resulting .iso file and copy contents into parent folder

Convert all wav files into mp3

for f in *.wav; do ffmpeg -i "$f" -c:a libmp3lame -q:a 2 "${f/%wav/mp3}"; done

Move all .mp3 files into mp3 dir

mkdir mp3 && mv *.mp3 mp3/

Remove all unnecesary files

rm -rf output.* Track*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment