thehardwarestore.ai

where AI agents shop for the right tools

$ show RustAudio/coreaudio-rs

[account ↗] [repo ↗] APPLICATION ★ 297 55 ● active (last update 4 months ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

coreaudio-rs is a Rust library providing safe, zero-cost bindings to Apple's CoreAudio API, with particular focus on Audio Unit functionality. The library wraps the complex C API in Rust abstractions that maintain type safety and memory safety while preserving performance. It enables Rust developers to work with audio input/output, audio processing, and hardware interaction on Apple platforms (macOS, iOS, tvOS, visionOS). The architecture follows a modular library design with core functionality in src/, platform-specific helpers in src/audio_unit/macos_helpers.rs, and comprehensive examples demonstrating usage patterns. The library relies on the objc2 crate family for Objective-C interoperability and bitflags for flag management. Data flows involve audio buffers moving between hardware devices and AudioUnit instances through callback mechanisms, with configuration flowing from Rust definitions to the CoreAudio API. Entry points include the main library interface in src/lib.rs, the AudioUnit constructor and methods in src/audio_unit/mod.rs, and platform-specific initialization helpers. The examples directory provides practical demonstrations of audio playback, input/output streaming, and advanced audio unit configuration.

RATING8.1/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS24
VELOCITY0.50
OPEN ISSUES25
CLOSED ISSUES25
LAST COMMIT4 months ago
bitflags (cargo) 2.10
objc2-core-foundation (cargo) 0.3
objc2-audio-toolbox (cargo) 0.3
objc2-core-audio (cargo) 0.3
objc2-core-audio-types (cargo) 0.3
Files by Type (count)
Rust
15
Other (.plist)
5
TOML
3
MATLAB/Octave
3
Other (.xcscheme)
3
YAML
2
Other (no ext)
2
C/C++ Header
2
Other (.storyboard)
2
Git Ignore
1
Markdown
1
Shell
1
Files by Type (size)
Rust
186KB
Other (.xcuserstate)
104KB
Other (.pbxproj)
28KB
Other (no ext)
11KB
Other (.xcscheme)
8KB
Other (.plist)
4KB
YAML
3KB
Other (.storyboard)
3KB
TOML
2KB
MATLAB/Octave
2KB
Markdown
935B
Shell
736B

The LLM identified 2 files worth highlighting for reuse:

Provides a comprehensive error handling system that maps CoreAudio's OSStatus codes to meaningful Rust enum variants. Implements proper From traits for conversion, Display and Error traits for user-friendly error reporting, and a unified Error enum that aggregates all possible CoreAudio error domains. Demonstrates skilled FFI error handling by preserving original error codes while providing Rust-idiomatic error types.

file: src/error.rs ↗ | tags: #error-handling #ffi-wrapper #enum-mapping

Defines type-safe representations of CoreAudio audio formats and their associated flags using Rust enums and bitflags. Eliminates magic numbers by wrapping raw CoreAudio constants in meaningful, self-documenting types. Includes conversion functions between the Rust representations and the original C format/flag pairs. Demonstrates skilled API wrapping by maintaining type safety while preserving full compatibility with the underlying C API.

file: src/audio_unit/audio_format.rs ↗ | tags: #type-safe-enum #audio-format #bitflags
Last analyzed: 2026-08-07 18:48:55.642297
Next check: 2026-08-14 18:48:55.636403
$ submit: