A lightweight ASCII art video and audio player in Rust that renders the Bad Apple animation directly inside your terminal with optional synchronized audio playback.
Clone the repository and run the player directly:
git clone https://github.com/adi-IL/bad_apple_rs.git
cd bad_apple_rs
cargo run --release -- playFor the best visual presentation, resize your terminal window to at least 80 columns by 60 rows.
To enable audio playback with rodio, build with the audio feature:
cargo run --release --features audio -- playNote for Linux users: Audio support requires ALSA development headers:
sudo apt-get install -y libasound2-dev pkg-config(Ubuntu/Debian) orsudo dnf install -y alsa-lib-devel pkgconf-pkg-config(Fedora).
- High performance ASCII rendering at 30 frames per second
- In-memory double-buffered rendering to eliminate terminal flickering
- Dynamic viewport centering based on current terminal dimensions
- Standalone offline playback with pre-encoded binary assets included
- Pure Rust default build requiring zero external C system libraries
- Optional audio playback engine powered by Rodio
- Built-in frame conversion tool to generate binary assets from raw image sequences
Play the default animation:
cargo run --release -- playPlay with audio enabled:
cargo run --release --features audio -- playSpecify custom frame binary or audio files:
cargo run --release -- play --input custom_frames.bin
cargo run --release --features audio -- play --input custom_frames.bin --audio custom_audio.oggConvert a directory of PNG frames into a single binary file:
cargo run --release -- build --frames-dir frames --output bad_apple.binThe build command reads sequential PNG files (such as frame_0001.png, frame_0002.png) scaled to 80x60 pixels and encodes them using an ASCII luminance ramp ( .:-=+*#%@).
| Command | Option | Default | Description |
|---|---|---|---|
play |
--input, -i |
bad_apple.bin |
Path to the encoded ASCII frames binary file |
play |
--audio, -a |
audio.ogg |
Path to the audio soundtrack file |
build |
--frames-dir, -f |
frames |
Directory containing sequential PNG frame files |
build |
--output, -o |
bad_apple.bin |
Output path for the generated binary file |
[ PNG Frame Sequence ] ---> [ build ] ---> [ bad_apple.bin (ASCII byte stream) ]
|
[ audio.ogg (Vorbis) ] ---> [ play ] <-----------+
|
+---------+---------+
| |
v v
[ Rodio Audio ] [ Crossterm TUI (MoveTo 0,0) ]
This project is distributed under the MIT License. See the LICENSE file for complete terms.