TheAmazingAudioEngine / TheAmazingAudioEngine

Core Audio, Cordially: A sophisticated framework for iOS audio applications, built so you don't have to.
Other
3.09k stars 572 forks source link

Ability to change input/output volume of AudioUnits #10

Open zobkiw opened 11 years ago

zobkiw commented 11 years ago

Suggestion: The ability to set the input/output volume of the AudioUnit when created (or later) - this may help control effects that need more headroom than is available in the source audio.

michaeltyson commented 11 years ago

Doesn't -[AEAudioUnitChannel setVolume] handle this?

zobkiw commented 11 years ago

So this is the output volume of the channel, correct? In theory you could manage the input volume by knowing the make-up of the graph and appropriately adjusting the output of the "thing" that is being input to this channel. However, it would be nice to not have to know that - what if you have multiple "things" connected to this input? For instance, if you have an AudioUnit that you know needs 3db of headroom to do its best work, it would be helpful to be able to adjust the gain on the input to that audio unit to -3db regardless of what is connected to that input.

Does that make sense? Or is my understanding wonky? :-)

michaeltyson commented 11 years ago

Ah, you're referring to audio unit filters (AEAudioUnitFilter), not channels, I think. It sounds a bit hacky, adding gain settings to filters like that - if the audio unit requires certain input/output parameters, is there not a way to specify these on the audio unit directly? Sounds like an audio unit bug if not!

zobkiw commented 11 years ago

I'll be digging into this again after this week and will report back with more detail.