From e175d64f4cd1d93df3a39c9d9c248125ce957490 Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Mon, 23 Apr 2018 16:05:13 +0545 Subject: [PATCH] Fix bug where input stream buffer was created using output stream format This happened to work in the past as in many cases the input stream will have less than or equal to the same number of channels as the output stream. Publishing as 0.9.1. --- Cargo.toml | 2 +- src/audio_unit/render_callback.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cac4e0083..e64a073fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "coreaudio-rs" -version = "0.9.0" +version = "0.9.1" authors = ["mitchmindtree ", "yupferris "] description = "A friendly rust interface for Apple's CoreAudio API." keywords = ["core", "audio", "unit", "osx", "ios"] diff --git a/src/audio_unit/render_callback.rs b/src/audio_unit/render_callback.rs index e1fcc7395..e0c5668a7 100644 --- a/src/audio_unit/render_callback.rs +++ b/src/audio_unit/render_callback.rs @@ -471,7 +471,7 @@ impl AudioUnit { // First, we'll retrieve the stream format so that we can ensure that the given callback // format matches the audio unit's format. let id = sys::kAudioUnitProperty_StreamFormat; - let asbd = self.get_property(id, Scope::Input, Element::Output)?; + let asbd = self.get_property(id, Scope::Input, Element::Input)?; let stream_format = super::StreamFormat::from_asbd(asbd)?; // If the stream format does not match, return an error indicating this.