How to listen to microphone input in real time? - iphone

I'm looking for a tutorial on how to listen to the microphone input while it is recording. I've been searching for a while but nothing really relevant comes up. Is this supported by the SDK or is it a bit of a hack to set up?
I've found this but I'd like to find something a little more educational.
Any tips?
Thanks!

It is supported, the framework is called Audio Sessions, the SDK guide is called "Audio Session Programming Guide", AudioSessionInitialize is probably a good starting point to learn the process.
I think there are a few decent example projects, aurioTouch I believe has some of the pieces you need.

Related

CoreAudio tempo change (iOS)

I'm very new to audio programming, but I know this must be possible. (This is an iOS/iPhone related question).
How would I go about changing the tempo of a loaded audio file without changing the pitch, and then playing it back?
I think I need to delve into the CoreAudio framework, but I'm not sure where to begin.
If anyone could let me know what classes I need to look at, or the general process involved, that would help me get started and I'd really appreciate it!
Cheers!
This question is highly related: it relates to pitch shifting, rather than time shifting, but I'd check out the comments and links.
Real-time Pitch Shifting on the iPhone
What you are looking for is a time-pitch modification library. Core Audio on iOS currently does not contain such, but there appear to be some 3rd party libraries available (commercially). There are also time pitch tutorials on the web, such as at dspdimention, which require a large amount of DSP development to get working.

iPhone Audio Modifications (filters/effects)

I am developing an app where the user can record their voice, and then alter it in some way. I have implemented OpenAL, and I am able to adjust the pitch to speed up and slow down the audio file. The thing is, I want to add filters like echo, reverb, etc.. I have scoured the internet for hours and have found nothing to help me. I came across a OpenAL called FreeSL, which has a bunch of filters built in, but I cannot get it compile in xcode.
I have also looked into Dirac3, but again all I am seeing is basic pitch/time controls; no echos or anything.
Can anyone point me in the direction a good framework or explain how OpenAL can handle filters like this?
Thanks!
I found a library that is exactly what I am looking for, FMOD:
http://www.fmod.org/index.php/fmod

How to develop an iphone app with reverb functionality?

I am developing an iPhone application (like Audio Processing). I have to give some effect to the audios.
If it is desktop app, many options are there. We can get good examples and full project like audacity. But I want to develop for iPhone.
I got an app with reverb option; (take a look at following link). Just I watch the "video", I did not test this application in my iPhone device.
http://www.appstorehq.com/reverb-iphone-89870/app
My question is; How can I develop the app with reverb functionality ? Is there any documentation for that ? If it is, just share with us.
NOTE: We can use AudioUnit to develop the app with reverb functionality (I am not clear with this.).
EDIT: I don't like to use any third party library.
If anybody having knowledge about this, please share with us.
Thanks.
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):
https://github.com/kstenerud/ObjectAL-for-iPhone/blob/master/ObjectAL/ObjectAL/OpenAL/ALListener.m
https://github.com/kstenerud/ObjectAL-for-iPhone/blob/master/ObjectAL/ObjectAL/OpenAL/ALSource.m
https://github.com/kstenerud/ObjectAL-for-iPhone/blob/master/ObjectAL/ObjectAL/OpenAL/ALWrapper.m
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).

iPhone AVAudioRecorder Guide?

Can anyone point me to a tutorial or discussion that provides a clear-cut, full explanation of how to use the AVAudioRecorder method of recording audio in iPhone apps? Although I'm new to iPhone programming in general, I do have a basic understanding and yet all my attempts to use AVAudioRecorder have failed miserable. Much appreciated!
Sample code and documentation can be found here. You can fill in the blanks with searches here on StackOverflow. If you haven't started with Audio, it's best to look at the Apple docs and example code first. Then have a look at other sources. This is where a good book on iPhone development comes in.
To use AVAudioRecorder you first need to enable the AVAudioSession and init and start AVAudioRecorder, here's my example of how to set everything up and measure the level of "loudness" for instance http://www.mikitamanko.com/blog/2017/04/15/swift-how-to-get-decibels/

Mod Player for iphone

I'm wondering if anyone has knowledge of any kind of modplayer library for iphone? I've searched, but couldn't find anything.
MikMod for the mac uses CoreAudio, so it might "just work" on the iPhone.
I successfully implemented a mod/s3m player on the iPhone using Audio Queue Services.
I have a chiptune player nearly finished : it's based on modplug for the module part.
basically it is as simple as recompiling the lib (modplug) and interface it with an audio buffer queue, as stated by Manuel.
here's a quick video of my stuff :
http://www.youtube.com/watch?v=jGJ560-qAio
do not hesitate to send an email if you need some help
For a non-app version, it may be worth checking out Matt Westcott's JSModPlayer:
http://matt.west.co.tt/music/jsmodplayer/
It is Javascript and heavily under development, already there is a fork of it on GitHub. It does work though, but is a bit of a CPU hog!