@@ -290,27 +290,28 @@ impl AudioUnit {
290
290
& mut self ,
291
291
stream_format : StreamFormat ,
292
292
scope : Scope ,
293
+ element : Element ,
293
294
) -> Result < ( ) , Error > {
294
295
let id = sys:: kAudioUnitProperty_StreamFormat;
295
296
let asbd = stream_format. to_asbd ( ) ;
296
- self . set_property ( id, scope, Element :: Output , Some ( & asbd) )
297
+ self . set_property ( id, scope, element , Some ( & asbd) )
297
298
}
298
299
299
300
/// Return the current Stream Format for the AudioUnit.
300
- pub fn stream_format ( & self , scope : Scope ) -> Result < StreamFormat , Error > {
301
+ pub fn stream_format ( & self , scope : Scope , element : Element ) -> Result < StreamFormat , Error > {
301
302
let id = sys:: kAudioUnitProperty_StreamFormat;
302
- let asbd = self . get_property ( id, scope, Element :: Output ) ?;
303
+ let asbd = self . get_property ( id, scope, element ) ?;
303
304
StreamFormat :: from_asbd ( asbd)
304
305
}
305
306
306
307
/// Return the current output Stream Format for the AudioUnit.
307
308
pub fn output_stream_format ( & self ) -> Result < StreamFormat , Error > {
308
- self . stream_format ( Scope :: Output )
309
+ self . stream_format ( Scope :: Input , Element :: Output )
309
310
}
310
311
311
312
/// Return the current input Stream Format for the AudioUnit.
312
313
pub fn input_stream_format ( & self ) -> Result < StreamFormat , Error > {
313
- self . stream_format ( Scope :: Input )
314
+ self . stream_format ( Scope :: Output , Element :: Input )
314
315
}
315
316
}
316
317
0 commit comments