Subject: Reverb audio unit does not work on iOS for me
Content-Type: text/plain; charset=us-ascii
Hello guys,
For some reason the reverb audio unit (kAudioUnitSubType_Reverb2) does not affect playback in my case. I added a delay effect and it works good. But the reverb effect produces the same output as without it. I can't hear any difference. What may be the reason? Does the reverb unit require some specific steps to setup, different from the delay unit? I also tried to change the default parameters for the reverb audio unit. The result is either the original sound or even silent playback.
Best regards,
Igor
Been asked this one a few times -- here are some bullet points from previous answers, hope they are helpful to you:
- For this unit the number of channels for Input/Output format must be the same & 32bit float. Asking the unit for its default format returns AudioStreamBasicDescription: 2 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved.
- As a trival test to play around with the verb, add the code below to iPhoneMixerEQGraphTest sample with the reverb AU added to the end of the graph and it will work as expected.
- You MUST modify the reverb units wet/dry mix (kReverb2Param_DryWetMix) and gain levels to taste to hear the effect. If you forget to set the wet/dry mix, you will hear no effect in the mix since I'm pretty sure the default value is 0% and not 100% wet as the docs state.
//error checks removed
// get the default input stream format of the reverb
CAStreamBasicDescription desc;
size = sizeof(desc);
result = AudioUnitGetProperty(mReverb, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &desc, &size);
....
// set the output stream format of the mixer
result = AudioUnitSetProperty(mMixer, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &desc, sizeof(desc));
// set the output stream format of the EQ
result = AudioUnitSetProperty(mEQ, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &desc, sizeof(desc));
// set the output stream format of the reverb
result = AudioUnitSetProperty(mReverb, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &desc, sizeof(desc));
...
// set wet/dry mix level to hear effect mixed in
- Use CAShow and the Print feature of CASBD for debugging to ensure things are set up down the chain as expected and alwasy check return codes for everything logging results as you go to quickly track down problems.
edward
|