<aside> 💾

Ultimate Experiments aren’t neccisary ReadyOS related, but generally fun little adventures with the C64 Ultimate, but sometimes just the C64 with a REU & VICE. Source Code, Binaries, Yada Yada

</aside>

Play Large Audio Samples in the background with Ultimate Audio

This experiment is NOT a SiD tune.. The code loads the song (examples ranging <500KB to 3.7MB included) into the Ram Expansion Unit , and instructs the ultimate to play it on a loop.

download, unzip and transfer to your c64 ultimate

usb1_kp_uaudio.zip

see the code https://gist.github.com/klumsy/69866d191c9799457f81d99a7c13db8e

examples for converting audio to these formats

FFmpeg conversion examples:
These make raw PCM bytes, not WAV files. Use quotes around filenames with
spaces. The output has no WAV header.

Endian and signedness notes:
- s8 is signed 8-bit PCM: one signed byte per sample.
- s16le is signed 16-bit little-endian PCM: low byte, then high byte.
- little-endian is the normal 6502-friendly byte order for 16-bit samples.
- Stereo raw files are interleaved: left sample, right sample, repeat.

Whole MP3 input file:
ffmpeg -y -i input.mp3 -ac 1 -ar 8000 -f s8 block8.raw
ffmpeg -y -i input.mp3 -ac 1 -ar 8000 -f s16le block16.raw
ffmpeg -y -i input.mp3 -ac 2 -ar 16000 -f s16le block16s.raw

Whole WAV input file:
ffmpeg -y -i input.wav -ac 1 -ar 8000 -f s8 block8.raw
ffmpeg -y -i input.wav -ac 1 -ar 8000 -f s16le block16.raw
ffmpeg -y -i input.wav -ac 2 -ar 16000 -f s16le block16s.raw

MP3 start plus length:
ffmpeg -y -ss 00:00:30 -i input.mp3 -t 60 -ac 1 -ar 8000 -f s8 block8.raw
ffmpeg -y -ss 00:00:30 -i input.mp3 -t 60 -ac 1 -ar 8000 -f s16le block16.raw
ffmpeg -y -ss 00:00:30 -i input.mp3 -t 60 -ac 2 -ar 16000 -f s16le block16s.raw

WAV start plus length:
ffmpeg -y -ss 00:00:30 -i input.wav -t 60 -ac 1 -ar 8000 -f s8 block8.raw
ffmpeg -y -ss 00:00:30 -i input.wav -t 60 -ac 1 -ar 8000 -f s16le block16.raw
ffmpeg -y -ss 00:00:30 -i input.wav -t 60 -ac 2 -ar 16000 -f s16le block16s.raw

MP3 start plus end time:
ffmpeg -y -ss 00:00:30 -to 00:01:30 -i input.mp3 -ac 1 -ar 8000 -f s8 block8.raw
ffmpeg -y -ss 00:00:30 -to 00:01:30 -i input.mp3 -ac 1 -ar 8000 -f s16le block16.raw
ffmpeg -y -ss 00:00:30 -to 00:01:30 -i input.mp3 -ac 2 -ar 16000 -f s16le block16s.raw

WAV start plus end time:
ffmpeg -y -ss 00:00:30 -to 00:01:30 -i input.wav -ac 1 -ar 8000 -f s8 block8.raw
ffmpeg -y -ss 00:00:30 -to 00:01:30 -i input.wav -ac 1 -ar 8000 -f s16le block16.raw
ffmpeg -y -ss 00:00:30 -to 00:01:30 -i input.wav -ac 2 -ar 16000 -f s16le block16s.raw

General forms:
ffmpeg -y -ss START -i input.mp3 -t LENGTH -ac 1 -ar RATE -f s8 out.raw
ffmpeg -y -ss START -i input.wav -t LENGTH -ac 1 -ar RATE -f s8 out.raw
ffmpeg -y -ss START -i input.mp3 -t LENGTH -ac 1 -ar RATE -f s16le out.raw
ffmpeg -y -ss START -i input.wav -t LENGTH -ac 1 -ar RATE -f s16le out.raw
ffmpeg -y -ss START -i input.mp3 -t LENGTH -ac 2 -ar RATE -f s8 out.raw
ffmpeg -y -ss START -i input.wav -t LENGTH -ac 2 -ar RATE -f s8 out.raw
ffmpeg -y -ss START -i input.mp3 -t LENGTH -ac 2 -ar RATE -f s16le out.raw
ffmpeg -y -ss START -i input.wav -t LENGTH -ac 2 -ar RATE -f s16le out.raw