audiotoolbox-rs
Safe Rust bindings for Apple’s AudioToolbox.framework on macOS via a Swift bridge.
Covered areas
audiotoolbox-rs 0.4.0 now ships bridge-backed wrappers for:
AudioFormatAudioFileAudioFileComponentExtAudioFileAudioConverterAudioComponentAudioUnitAUAudioUnitAUGraphAVFAudio(AVAudioEngine/AVAudioNode/AVAudioFormat/AVAudioPCMBuffer/AVAudioSequencer)AudioQueueMusicSequence/MusicPlayer/MusicEventIteratorAudioServicesAudioFileStreamCAFFile
The original raw C surface is still available behind the raw-ffi Cargo feature, and the audit-filling long-tail C declarations are available under audiotoolbox::generated_c_types.
Installation
[]
= "0.4.0"
To reach the legacy raw C bindings as well:
[]
= { = "0.4.0", = ["raw-ffi"] }
Quick start
use AudioFile;
Async callback streams
Enable the async feature for executor-agnostic wrappers over property listeners and render-notify callbacks. Render-notify streams use a real-time-safe SPSC handoff; synchronous pull-render callbacks remain manual.
[]
= { = "0.4.0", = ["async"] }
use ;
# async
Highlights
- ScreenCaptureKit-style Swift bridge with one bridge file per logical area
- Owned Rust handles with
Drop AudioFile,AudioFileComponent,ExtAudioFile, andAudioFileStreamsmoke-tested againstGlass.aiff- In-memory
AudioConverterone-shot conversion helper AudioUnit,AUAudioUnit,AUGraph, andMusicSequence/MusicPlayer/MusicEventIteratorcreation helpersAVAudioEngine/AVAudioNode/AVAudioFormat/AVAudioPCMBuffer/AVAudioSequencerwrappers for the commonAVFAudiopath plus exact-name audit aliases for the remaining sampled surface- Pure-Rust
CAFFileheader parsing helpers - 15 numbered examples and 16 integration smoke tests, including an exhaustive symbol-surface smoke test for every former audit gap
Examples
for; do ; done
Highlights:
01_read_glass04_ext_audio_file_decode07_audio_unit_converter08_audio_queue_output10_audio_file_stream11_caf_header12_avfaudio13_au_audio_unit14_au_graph15_audio_file_component
Validation
Verified with:
for; do ; done
Coverage audit
See COVERAGE_AUDIT.md for the sampled public-symbol coverage scoreboard and COVERAGE.md for the header-by-header audit of implemented, partial, and skipped APIs.
License
Licensed under either of:
- MIT license (LICENSE-MIT)
- Apache License, Version 2.0 (LICENSE-APACHE)