How to develop an iphone app with reverb functionality?

南楼画角 提交于 2019-11-28 08:47:13

if yourre targeting ios5 you can just the audio unit subtype kAudioUnitSubType_Reverb2 of the effect audio unit.

reverb unit

AudioComponentDescription auEffectUnitDescription;
    auEffectUnitDescription.componentType = kAudioUnitType_Effect;
    auEffectUnitDescription.componentSubType = kAudioUnitSubType_Reverb2;
    auEffectUnitDescription.componentManufacturer = kAudioUnitManufacturer_Apple;

AUGraphAddNode(
                              processingGraph,
                              &auEffectUnitDescription,
                              &auEffectNode), 

Failing that you could just write your own reverb code in the remoteio callback. A simple delay might be easier to do and would sound similar.

iOS 5.0 brings native OpenAL support, so it is now much easier - you don't have to code the algorithm yourself. It also bring support for a variety of reverb spaces:

  • Small Room
  • Medium Room
  • Large Room (2 configurations)
  • Medium Hall (3 configurations)
  • Large Hall (2 configurations)
  • Plate
  • Medium Chamber
  • Large Chamber
  • Cathedral

I suggest that you try the ObjectAL wrapper which already has a great support for the reverb effect: https://github.com/kstenerud/ObjectAL-for-iPhone

Grab the source from this repository, load "ObjectAL.xcodeproj" and run the ObjectALDemo target on any iOS 5.0 device (should also work on the simulator). This will give you a good starting point and feeling of what the reverb effect is capable of.

If you still don't to use any 3rd party library, you can just grab the relevant pieces from ObjectAL. Look for the reverb-related code in the following source files (and their corresponding headers):

Good luck with your project!

AUs are a good place to start.

write your own reverb AU which contains a reverb implementation. there are tons of ways to implement a reverb. a medium/long convolution reverb is much to ask from a phone, but something such as a FDN (feedback delay network) will not require a lot of memory or CPU.

both implementations are easy to implement, if you're familiar with audio programming and optimization. the tough part is actually making one that sounds very good and performs well.

if you're unable to write optimal low level code or you do not (presently) understand basic audio signal processing, then you'll have a few obstacles to overcome -- it may be a long road in that case.

Searching the iOS documentation for "reverb" produces a link to the Core Audio Overview, which references reverb as an "effect unit." Perhaps that's worth further study?

No good, I have attempted the audio unit approach and even though it is in the documentation it is "not" implemented yet by the apple engineers. Each time you call the function to set the reverb property you will only get failure status code. You would have to implement your own reverb effect. Try reading some DSP book and you might find a clue.

you need to learn some DSP-level coding, the DSP cookbook book is okay and there are others out there. But basically you need to be comfortable with handling audio signal in the frequency domain and things such as FFT's. Once you have that, implementing a reverb filter should be straight-forward.

This is an answer I've given before, but I believe it is relevant here. I am going to agree with the others and say that you are going to have to become a bit more familiar with core-audio if you want to do this properly.

I highly recommend this core-audio book. It will teach what you need to do this right and will save you a lot of frustration.

The chapter on audio effects has not been published yet, but if it is anything like the rest of the book it's worth the wait.

EDIT

You will most likely need to do this with an audio effect (which is a form of an audio unit).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!