@@ -10,7 +10,11 @@ use std::sync::Mutex;
10
10
use std:: time:: Duration ;
11
11
use std:: { mem, thread} ;
12
12
13
- use crate :: sys:: {
13
+ use libc:: pid_t;
14
+ use objc2_audio_toolbox:: {
15
+ kAudioOutputUnitProperty_CurrentDevice, kAudioOutputUnitProperty_EnableIO,
16
+ } ;
17
+ use objc2_core_audio:: {
14
18
kAudioDevicePropertyAvailableNominalSampleRates, kAudioDevicePropertyDeviceIsAlive,
15
19
kAudioDevicePropertyDeviceNameCFString, kAudioDevicePropertyHogMode,
16
20
kAudioDevicePropertyNominalSampleRate, kAudioDevicePropertyScopeOutput,
@@ -19,22 +23,20 @@ use crate::sys::{
19
23
kAudioHardwarePropertyDevices, kAudioObjectPropertyElementMaster,
20
24
kAudioObjectPropertyElementWildcard, kAudioObjectPropertyScopeGlobal,
21
25
kAudioObjectPropertyScopeInput, kAudioObjectPropertyScopeOutput, kAudioObjectSystemObject,
22
- kAudioOutputUnitProperty_CurrentDevice, kAudioOutputUnitProperty_EnableIO,
23
26
kAudioStreamPropertyAvailablePhysicalFormats, kAudioStreamPropertyPhysicalFormat,
24
27
AudioDeviceID , AudioObjectAddPropertyListener , AudioObjectGetPropertyData ,
25
28
AudioObjectGetPropertyDataSize , AudioObjectID , AudioObjectPropertyAddress ,
26
- AudioObjectPropertyScope , AudioObjectRemovePropertyListener , AudioObjectSetPropertyData ,
27
- AudioStreamBasicDescription , AudioStreamRangedDescription , AudioValueRange , OSStatus ,
29
+ AudioObjectPropertyListenerProc , AudioObjectPropertyScope , AudioObjectRemovePropertyListener ,
30
+ AudioObjectSetPropertyData , AudioStreamRangedDescription ,
28
31
} ;
29
- use libc:: pid_t;
30
- use objc2_core_audio:: AudioObjectPropertyListenerProc ;
32
+ use objc2_core_audio_types:: { AudioBufferList , AudioStreamBasicDescription , AudioValueRange } ;
31
33
use objc2_core_foundation:: CFString ;
32
34
33
35
use crate :: audio_unit:: audio_format:: { AudioFormat , LinearPcmFlags } ;
34
36
use crate :: audio_unit:: sample_format:: SampleFormat ;
35
37
use crate :: audio_unit:: stream_format:: StreamFormat ;
36
38
use crate :: audio_unit:: { AudioUnit , Element , IOType , Scope } ;
37
- use crate :: sys ;
39
+ use crate :: OSStatus ;
38
40
39
41
/// Helper function to get the device id of the default input or output device.
40
42
pub fn get_default_device_id ( input : bool ) -> Option < AudioDeviceID > {
@@ -236,7 +238,7 @@ pub fn get_audio_device_supports_scope(devid: AudioDeviceID, scope: Scope) -> Re
236
238
try_status_or_return ! ( status) ;
237
239
238
240
let mut bfrs: Vec < u8 > = Vec :: with_capacity ( data_size as usize ) ;
239
- let buffers = bfrs. as_mut_ptr ( ) as * mut sys :: AudioBufferList ;
241
+ let buffers = bfrs. as_mut_ptr ( ) as * mut AudioBufferList ;
240
242
unsafe {
241
243
let status = AudioObjectGetPropertyData (
242
244
devid,
0 commit comments