Revision control

Copy as Markdown

Other Tools

use crate::dispatch::*;
use coreaudio_sys::*;
// this first appeared in MacOS 10.13 and iOS 11.0.
extern "C" {
fn AudioDeviceDuck(
inDevice: AudioDeviceID,
inDuckedLevel: f32,
inStartTime: *const AudioTimeStamp,
inRampDuration: f32,
) -> OSStatus;
}
pub fn audio_device_duck(
in_device: AudioDeviceID,
in_ducked_level: f32,
in_start_time: *const AudioTimeStamp,
in_ramp_duration: f32,
) -> OSStatus {
debug_assert_running_serially();
unsafe { AudioDeviceDuck(in_device, in_ducked_level, in_start_time, in_ramp_duration) }
}