11//! Audio capture primitives for Voxit.
22
3+ use std:: sync:: mpsc:: Receiver ;
4+ #[ cfg( target_os = "macos" ) ]
35use std:: {
46 io:: Cursor ,
5- sync:: {
6- Arc , Mutex ,
7- atomic:: AtomicU64 ,
8- mpsc,
9- mpsc:: { Receiver , SyncSender } ,
10- } ,
7+ sync:: { Arc , Mutex , atomic:: AtomicU64 , mpsc, mpsc:: SyncSender } ,
118 time:: Instant ,
129} ;
1310
@@ -18,8 +15,8 @@ use coreaudio::audio_unit::{
1815 macos_helpers,
1916 render_callback:: { Args , data:: Interleaved } ,
2017} ;
21- use coreaudio:: error:: Error ;
22- use hound:: { WavSpec , WavWriter } ;
18+ # [ cfg ( target_os = "macos" ) ] use coreaudio:: error:: Error ;
19+ # [ cfg ( target_os = "macos" ) ] use hound:: { WavSpec , WavWriter } ;
2320#[ cfg( target_os = "macos" ) ]
2421use objc2_audio_toolbox:: {
2522 kAudioOutputUnitProperty_CurrentDevice, kAudioOutputUnitProperty_EnableIO,
@@ -95,6 +92,7 @@ pub struct Recorder {
9592
9693#[ cfg( not( target_os = "macos" ) ) ]
9794#[ derive( Debug ) ]
95+ /// Stub recording handle for unsupported platforms.
9896pub struct Recorder ;
9997#[ cfg( target_os = "macos" ) ]
10098impl Recorder {
@@ -234,6 +232,7 @@ impl Recorder {
234232
235233#[ cfg( not( target_os = "macos" ) ) ]
236234#[ derive( Debug ) ]
235+ /// Stub recording payload for unsupported platforms.
237236pub struct Recording ;
238237
239238#[ cfg( not( target_os = "macos" ) ) ]
0 commit comments