Platform audio session management for OxiSound.
This crate provides safe wrappers around platform-specific audio session management APIs:
- iOS / macOS:
AVAudioSessionviaobjc2-avf-audio(enabled by theavf-audiofeature) - All other platforms: stub implementations that document platform support
and return
OxiSoundError::UnsupportedConfigwhere appropriate.
COOLJAPAN Policy
The avf-audio feature introduces Objective-C FFI via objc2, which requires
unsafe call sites. This crate therefore does not carry
#![forbid(unsafe_code)]. All unsafe blocks are narrowly scoped to objc2
API calls and do not expose unsafe to callers — every public function in this
crate has a safe signature.
Default features are 100% Pure Rust (the avf-audio feature is opt-in).
Usage
use oxisound_session::{configure_session, SessionCategory};
configure_session(SessionCategory::Playback).expect("session configure failed");
let granted = oxisound_session::request_microphone_permission()
.unwrap_or(false);
println!("microphone granted: {granted}");