coreaudio-rs
coreaudio-rs copied to clipboard
Fix input and output scope and element usage.
Getting input from a microphone needs to use the Output scope and Input Element, and sending audio to a speaker needs to use the Input Scope and Output Element. See Figure 1-3 in https://developer.apple.com/library/archive/documentation/MusicAudio/Conceptual/AudioUnitHostingGuide_iOS/AudioUnitHostingFundamentals/AudioUnitHostingFundamentals.html
This PR also removes a bit of redundancy in the code by reusing input and output stream functions in the callback code.