FoxRedbook 1.0.0-alpha.3
dotnet add package FoxRedbook --version 1.0.0-alpha.3
NuGet\Install-Package FoxRedbook -Version 1.0.0-alpha.3
<PackageReference Include="FoxRedbook" Version="1.0.0-alpha.3" />
<PackageVersion Include="FoxRedbook" Version="1.0.0-alpha.3" />
<PackageReference Include="FoxRedbook" />
paket add FoxRedbook --version 1.0.0-alpha.3
#r "nuget: FoxRedbook, 1.0.0-alpha.3"
#:package FoxRedbook@1.0.0-alpha.3
#addin nuget:?package=FoxRedbook&version=1.0.0-alpha.3&prerelease
#tool nuget:?package=FoxRedbook&version=1.0.0-alpha.3&prerelease
FoxRainbowBooks
Cross-platform, AOT-compatible .NET 8 libraries for optical disc I/O — named for the Rainbow Books that define the CD family of standards.
SCSI Transport Layer
The shared foundation. All disc I/O flows through IScsiTransport — a platform-neutral interface over the OS-specific SCSI passthrough mechanism. Both FoxRedbook and FoxOrangebook build on it.
| Platform | Backend | Tested Hardware |
|---|---|---|
| Windows | DeviceIoControl + SCSI_PASS_THROUGH_DIRECT |
Pioneer BDR-XS07U |
| Linux | ioctl(SG_IO) |
Pioneer BDR-XS07U |
| macOS | IOKit MMCDeviceInterface |
Pioneer BDR-XS07U |
Device paths: D: or \\.\CdRom0 on Windows, /dev/sr0 on Linux, disk1 on macOS.
- AOT-compatible — all P/Invoke uses
LibraryImportsource generation, no runtime marshalling - Zero external dependencies at runtime
<img src="assets/foxredbook.png" width="32" height="32" align="top"/> FoxRedbook — CD-DA Ripping
Bit-perfect audio CD ripping with AccurateRip verification. Named for the Red Book specification (IEC 60908).
dotnet add package FoxRedbook
- WiggleEngine cross-read verification with automatic jitter correction, dropped/duplicated byte detection, and scratch repair via re-reads
- AccurateRip v1/v2 checksum computation — verified against the community database
- Embedded drive offset database (4,800+ drives from AccurateRip) with automatic offset correction
- Disc fingerprinting — MusicBrainz, freedb/CDDB, and AccurateRip disc IDs from the TOC alone
- CD-Text parser (READ TOC format 5) with CRC-16 validation
Quick Start — Ripping
using FoxRedbook;
using var drive = OpticalDrive.Open("D:");
// One call gets TOC, disc IDs, and CD-Text
DiscInfo info = await drive.ReadDiscInfoAsync();
Console.WriteLine($"MusicBrainz ID: {info.MusicBrainzDiscId}");
Console.WriteLine($"Tracks: {info.Toc.TrackCount}");
if (info.CdText is { } cdText)
{
Console.WriteLine($"Album: {cdText.AlbumTitle} by {cdText.AlbumPerformer}");
}
// Rip a track with automatic offset correction
using var session = RipSession.CreateAutoCorrected(drive);
var track = info.Toc.Tracks[0];
await foreach (var sector in session.RipTrackAsync(track))
{
// sector.Pcm contains 2,352 bytes of verified 16-bit stereo 44.1kHz audio
}
// AccurateRip checksums available after the track is fully consumed
uint arV1 = session.GetAccurateRipV1Crc(track);
uint arV2 = session.GetAccurateRipV2Crc(track);
Drive Offset Correction
AccurateRip checksums depend on applying the correct read offset for your drive model. FoxRedbook ships an embedded database of 4,800+ drive offsets. RipSession.CreateAutoCorrected(drive) handles the lookup and wrapping automatically.
For manual control:
int? offset = KnownDriveOffsets.Lookup(drive.Inquiry);
if (offset is int samples)
{
using var corrected = new OffsetCorrectingDrive(drive, -samples);
using var session = new RipSession(corrected);
// ...
}
<img src="assets/foxorangebook.png" width="32" height="32" align="top"/> FoxOrangebook — CD-R/CD-RW Burning
Disc-At-Once audio CD burning. Named for the Orange Book specification that defines CD-R and CD-RW.
dotnet add package FoxOrangebook
- Disc-At-Once (DAO) burning — the whole disc in one pass, no inter-track gaps or run-out blocks
- Cue sheet pre-programming per MMC-6
- Buffer underrun protection (BURN-Free / SafeBurn)
- CD-RW blanking (full and minimal)
- File-backed transport — "burn" to a .bin/.cue file pair for testing or archival without touching hardware
- Track metadata — title and performer per track, written to cue sheet
- CD-Text — disc and track title/performer burned into the lead-in (Latin-1; falls back to a plain burn if the drive rejects the CD-Text cue sheet)
- Disc capacity, eject, write speed — capacity from READ DISC INFORMATION,
Eject()after the burn,WriteSpeedKBpsburn option
Quick Start — Burning
using FoxOrangebook;
using FoxRedbook;
using var drive = OpticalDrive.Open("D:");
var transport = (IScsiTransport)drive;
var session = new BurnSession(transport);
var tracks = new List<AudioTrackSource>
{
new() { Pcm = File.OpenRead("track01.raw"), Title = "Song One", Performer = "Artist" },
new() { Pcm = File.OpenRead("track02.raw"), Title = "Song Two", Performer = "Artist" },
};
await session.BurnAsync(tracks);
Burn to File
Test the full burn pipeline without a blank disc:
using var transport = new FileBackedBurnTransport("output.bin")
{
DiscTitle = "My Album",
DiscPerformer = "Various Artists",
TrackMetadata = tracks.Select(t => (t.Title, t.Performer)).ToList(),
};
var session = new BurnSession(transport);
await session.BurnAsync(tracks);
// Produces output.bin + output.cue — playable in foobar2000
Building
dotnet build
dotnet test
The default test suite runs on any .NET 8 host with no hardware required. Hardware tests auto-detect optical drives and run when one is available with an audio CD inserted.
License
MIT. See LICENSE.
Test data files (cdtext.cdt, cdtext.right) are sourced from libcdio (GPL) and used unmodified for parser verification only. They are not included in the NuGet package. See ATTRIBUTION.md.
Audio test assets in assets/ are public domain recordings. See assets/ATTRIBUTION.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on FoxRedbook:
| Package | Downloads |
|---|---|
|
FoxOrangebook
Disc-At-Once audio CD burning with cue sheet programming, buffer underrun protection, and file-backed burn simulation |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-alpha.3 | 204 | 7/23/2026 |
| 1.0.0-alpha.2 | 115 | 5/11/2026 |
| 1.0.0-alpha.1 | 84 | 4/13/2026 |