Skip to content

Hyphonical/Rewind.png

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽต Rewind.png

Digital cassette tapes disguised as PNG images

Rewind.png is an experimental media format that embeds lossless audio (FLAC/MP3/OGG/WAV) inside PNG images without corrupting the visual data. Think of it as a modern cassette tape; The PNG is the box art, and the embedded audio is the music inside.

Version License Rust


๐ŸŽฌ Demo

๐Ÿ“ผ Click to view the demo cassette (27.5 MB)

Demo Cassette

Try it: rewind tui demo/Cassette.png


๐ŸŽฏ Why?

The ritual of physical media is dead. Music streaming is convenient, but it's also ephemeralโ€”tracks disappear, playlists break, and there's no object to treasure. Rewind.png brings back:

  • Tangible ownership: One file = one album + its cover art
  • Intentional curation: Like burning a mixtape, each cassette is deliberate
  • Fragility by design: Re-compress the image? The audio breaks. This forces careful handling, just like vinyl records.

Use cases:

  • Gift custom mixtapes with personalized cover art
  • Archive music collections with embedded album art
  • Share music in a nostalgic, tactile format

๐Ÿ› ๏ธ How It Works

Polyglot File Structure

PNG Header Image Data (IDHR, IDAT Chunks) IEND Chunk
Table of Contents (TOC) - Track count - Track names & sizes
Audio Track 1 (FLAC/MP3/OGG/WAV) Audio Track 2 ...
CRC32 Checksum (Integrity Seal)

To image viewers: It's just a normal PNG.
To Rewind: It's a playable cassette with embedded audio.

Security Model

  • Whitelist-only formats: Only FLAC, MP3, OGG, and WAV are allowed
  • CRC32 integrity check: If the file is modified (e.g., re-encoded by social media), playback is blocked with: "This cassette has been damaged."
  • Non-destructive embedding: The PNG image remains fully viewable

๐Ÿ“ฆ Installation

Prerequisites

  • Rust 1.70+ (Install Rust)
  • Audio files (FLAC/MP3/OGG/WAV)
  • PNG image (for cassette cover art)

Build from Source

git clone https://github.com/Hyphonical/Rewind.png.git
cd Rewind.png
cargo build --release

Binary will be in target/release/rewind

System Requirements

  • OS: Windows 10+, macOS 10.15+, or Linux (any modern distro)
  • Terminal: Unicode support recommended for TUI (Windows Terminal, iTerm2, etc.)
  • Audio: Working audio output device

๐Ÿš€ Usage

1. Create a Cassette (Record)

Inject audio files into a PNG image:

rewind record cover.png track1.flac track2.flac track3.flac -o mixtape.png

Output: mixtape.png (viewable as image, playable as audio)

2. Inspect a Cassette

View embedded tracks and verify integrity:

rewind inspect mixtape.png

Example output:

[00:00:00] โœ”  Checksum matches. The file is intact.
[00:00:00] ๐’Š  TOC: 6 audio file(s)
[00:00:00] ๐’Š    [1] Track_1.flac (10000000 bytes) | ๐ŸŽต Artist 1 - Track 1 [1:23]
[00:00:00] ๐’Š    [2] Track_2.flac (10000000 bytes) | ๐ŸŽต Artist 2 - Track 2 [1:23]
...

3. Play a Cassette

Play a random track (for testing):

rewind play mixtape.png

Output:

[00:00:00] โœ”  โ–ถ Now Playing: Artist 1 - Track 1 [1:23]
[00:00:00] ๐’Š  Press Ctrl+C to stop.

4. Interactive TUI Player (NEW in v0.5!)

Open the full-featured skeuomorphic cassette player:

rewind tui mixtape.png

Features:

  • ๐ŸŽจ Vintage cassette design with animated progress bar and spinning reels
  • ๐Ÿ–ฑ๏ธ Mouse support - click buttons directly or select tracks
  • ๐Ÿ”Š Volume control with visual slider (0-100%)
  • ๐Ÿ“œ Dynamic playlist that auto-sizes based on track count
  • โฏ๏ธ Full playback controls with visual feedback

Keyboard Controls:

Key Action
โ†‘/โ†“ or j/k Navigate tracks
Enter Play selected track
Space Pause/Resume
โ†/โ†’ or p/n Previous/Next track
+/- Volume up/down
S Stop playback
Q or Esc Quit

Mouse Controls:

  • Click on any button (โฎ โ–ถ โธ โ–  โญ) to control playback
  • Click on a track in the playlist to play it
  • Click volume buttons to adjust audio level

Note: Your terminal must support Unicode box-drawing characters and mouse input for the best experience.


๐Ÿ—บ๏ธ Roadmap

โœ… Version 0.1 - Foundation (Completed)

  • Core polyglot PNG/audio embedding
  • Record audio tracks into PNG images
  • Inspect cassette metadata & verify integrity
  • Basic CLI playback

โœ… Version 0.2 - CLI Refinement (Completed)

  • Structured CLI with clap
    • rewind record <image> <audio...> -o <output>
    • rewind inspect <cassette>
    • rewind play <cassette> [--track N]
  • Sequential playback (auto-advance tracks)
  • Improved error handling and user feedback

โœ… Version 0.3 - Basic TUI (Completed)

  • Terminal UI with ratatui
  • Interactive track selection
  • Progress bar + metadata display
  • Keyboard navigation

โœ… Version 0.4 - Enhanced Playback (Completed)

  • Improved audio handling with rodio
  • Track metadata extraction (artist, title, duration)
  • CRC32 integrity verification
  • Pause/resume functionality

โœ… Version 0.5 - Skeuomorphic TUI (Current)

  • Complete UI redesign with vintage cassette aesthetics
  • Mouse support (clickable buttons)
  • Volume control with visual slider
  • Dynamic playlist sizing
  • Auto-play next track

๐Ÿšง Version 0.6 - Polish & Distribution (Planned)

  • Pre-built binaries for Windows, macOS, Linux
  • Installer/package manager support
  • Configuration file support (default volume, theme)
  • Error recovery (handle corrupted tracks gracefully)

๐ŸŽฏ Version 1.0 - Desktop GUI (Future)

  • Native desktop app with Tauri
  • Drag-and-drop cassette loading
  • Visual cover art display
  • Cassette library (recently played)

๐ŸŒŸ Version 2.0+ - Advanced Features (Dreams)

  • Web-based player (WASM)
  • Multi-cassette mixtapes

๐Ÿ“œ License & Attribution

Code

This project is licensed under the MIT License. See LICENSE for details.

Demo Content

Demo Cassette Image (demo/Cassette.png):

  • Cover art ยฉ 2025 Hyphonical. Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).
  • You may: Share and redistribute the image with proper attribution
  • You may not: Modify, remix, or create derivative works, or use it for commercial purposes.
  • The Sonyยฎ trademark shown on the demo cassette is used for aesthetic purposes only. Sony is a registered trademark of Sony Corporation. This project is not affiliated with, endorsed by, or sponsored by Sony Corporation.

Demo Audio Tracks:
All tracks by Kevin MacLeod (incompetech.com):

  • "Aquarium"
  • "Sugar Plum Breakdown"
  • "Hall of the Mountain King"

Licensed under Creative Commons: By Attribution 4.0 License


๐Ÿ“ Notes

A great part of this project was created using various AI models, including Claude Sonnet & Opus, Gemini 3 Pro & Flash, and Grok Code Fast 1. Without these tools I would not have been able to create Rewind.png in this timeframe.


Made with ๐Ÿ’–

About

๐Ÿ“ผ Embed lossless audio inside PNG images - Digital cassette tapes for the modern age

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors