Show HN: CD-DA Reader, Rust library to read audio CD data
The article introduces a Rust library called CD-DA Reader designed to read audio CD data in a cross-platform manner, supporting Windows, macOS, and Linux. It enables functionalities such as CD ripping and live audio playback by abstracting low-level operations like drive access and data reading. The library handles tasks including detecting CD drives, reading the table of contents (ToC), and reading track data using logical block addresses (LBA) or time-based MSF format.
- ▪The CD-DA Reader is a Rust library for reading audio CDs, primarily intended for CD ripping and live playback.
- ▪It supports cross-platform operation and manages drive access, ToC reading, and track data extraction.
- ▪On macOS, drive detection is limited due to system-level exclusivity and auto-mounting behaviors that interfere with access.
- ▪The library uses LBA (Logical Block Address) for internal data reading and MSF (Minutes:Seconds:Frames) for metadata services like MusicBrainz disc ID.
- ▪Track reading is a blocking operation, but a streaming API is available for incremental data processing.
Opening excerpt (first ~120 words) tap to expand
Rust CD-DA reader This is a simple library to read audio CDs. At the core it was written to enable CD ripping, but you can also implement a live audio CD player with its help. It is cross-platform and tested on Windows, macOS and Linux and abstracts both access to the CD drive and reading the actual data from it. All operations happen in this order on each platform: Get a CD drive's handle Read ToC (table of contents) of the audio CD Read track data using ranges from ToC Let's go through each concept in order. CD access First thing, we'll need to get a hold of the CD drive. You can see the drive's letter on Windows in File Explorer (although the actual handle will be something like "\\.\E:"), with cat /proc/sys/dev/cdrom/info on Linux and with diskutil list on macOS.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at GitHub.