CATCODEC(1)

✨ NAME ✨

okay so bestie, meet catcodec(1) β€” an open source tool that decodes/encodes the sample catalogue for OpenTTD πŸ’– like, the whole entire vibe of this lil program is sample catalogue wrangling, and honestly? she ate.


🌸 SYNOPSIS 🌸

catcodec [-d sample_file] [-e sample_file]

That's it. That's the whole invocation. Two flags, zero drama, main character energy πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so catcodec decodes and encodes sample catalogues for OpenTTD. and what even is a sample catalogue, you ask? bestie it's lowkey not much β€” just some meta-data (a description and a file name, that's it) plus raw PCM data. that's the whole thing. iconic minimalism, ngl.

Decoding a sample catalogue β€” say sample.cat β€” gives you back a sample.sfo that holds the file names and descriptions of the samples, PLUS all the samples themselves, each written out with the file name that's specified in the catalogue. so you get the receipts and the goods, periodt πŸŽ€

Encoding a sample catalogue β€” like sample.cat β€” reads sample.sfo for the file names and descriptions. then it loads up all the samples that sample.sfo describes and encodes them into sample.cat. so it's giving assemble-the-whole-squad 🫢

Generally speaking, encoding a file and then decoding it results in the same file. fr fr. BUT β€” and this is the important part, don't skip it β€” decoding of the original, Transport Tycoon Deluxe, sample format will force the output to be 11025 Hz, 8 bits mono because the meta-data of some of the samples is incorrect or even missing. like, the OG files are lying to you a little bit 😭 so catcodec just makes the call for you.

Only PCM WAVE files with only the format and data chunks are supported. anything else has to be converted into that first, no exceptions bestie.

Furthermore, only 11025 Hz, 22050 Hz and 44100 Hz with 8 or 16 bits per sample single channel PCM WAVE files are supported. so like... three sample rates, two bit depths, one channel. that's the menu 🌈


πŸ’… OPTIONS πŸ’…

  • -d sample_file β€” Decode the given sample catalogue into its components. The sample_file must have the extension .cat. For the output meta-data file the .cat is replaced with .sfo. The actual samples, in PCM WAVE format, are extracted into files using the file names, including extension, as described in the catalogue or meta-data file.

If any of the files already exists a backup is made, by adding .bak, overwriting the existing backup. so yeah β€” she's polite, she backs things up, but she WILL steamroll the previous backup. one backup, one chance πŸ™ˆ

  • -e sample_file β€” Encode the components for the given sample file into a sample catalogue. The sample_file must have the extension .cat. For the input meta-data file the .cat is replaced with .sfo. The actual samples, in PCM WAVE format, are read from files using the file names, including extension, as described in the meta-data file.

If the sample_file already exists a backup is made, by adding .bak, overwriting the existing backup. same deal, same energy, bestie πŸ“


πŸ”₯ SEE ALSO πŸ”₯

openttd(1) β€” the game that uses these sample catalogues. like, the reason any of this exists. go say hi πŸ‘‘


πŸ‘‘ AUTHORS πŸ‘‘

Remko Bijker ⟨rubidium@openttd.org⟩


and that's the whole page, bestie β€” written back on November 05, 2009 in the CATCODEC(1) manual, and yeah, the header said catcodec(1) and the footer said CATCODEC(1) and now you know both πŸ’œ slay, go encode something ✨🧚

πŸ“¦ where this page comes from