Record AVAudioPlayer output using AVAudioRecorder - iphone

In my application, I have list of Buttons when i click on one button corresponding music will be played. I want to record the sounds coming while playing the audio using avaudioplayer. But when i start recording while playing sounds nothing is recorded, Is it possible to record the sounds from avaudioplayer.
Thank You.

You might like to check-out this thread.

Related

playing multiple sounds(mp3, wav etc) in an iOS app

This is my requirement. I have set of audio files(mp3, wav mostly). My app's interface will have a list of these sound names and a toggle ON/OFF switch for each of the sound item. On switching a sound ON it should start playing and vice versa. If more than one sound is ON then they should be played simultaneously. I can switch any sound ON/OFF while the sound is playing and it should switch off instantly.
What classes are best suggested for this behavior ? Do I need to mix the sounds etc or just instantiate multiple AVAudioPlayer instances ???
Please guide me in making an efficient app.
Thanks!
Use different instance of AVAudioPlayer for playing simultaneously.
Now maintain list of AVAudioPlayer instance into NSMutableArray depending on state ON/OFF. if state ON then play audio add AVAudioPlayer instance in array and if state OFF then stop audio remove AVAudioPlayer instance from array.
You can user openAL to do your task. Here is the link to get it https://github.com/kstenerud/ObjectAL-for-iPhone .

Combine two audio files together and play them in iPhone

I do not want any code but want to get a reference about my question mentioned below...
There is background music available and there is recording option in my app...
Once I start recording , application records my sound and when play button clicks , It will play the recording along with the background music...
I had use this Link but can not get as I want...
I think there is a mechanism like merging two audio files and make it one before playing....
How can I achieve this by coding... Is there any reference link or any sample code available?
Thnx in advance...
Most people mistake the one instance of AVAudioPlayer as the unit that plays the sound directly, but it doesnt. Mixing is done by the OS, not by the instance of AVAudioPlayer.
With other words:
No one says you can't have more then one AVAudioPlayer.
Create one for you background and let it play. Create another instance of AVAudioPlayer for you recorded sound and let it play. Voila

Recording and then Playing Audio using AVAudioRecorder and AVAudioPLayer

I have an AVAudioRecorder that captures the sound. What I want is to be able to Play(AVAudioPlayer) the recorded(AVAudioRecorder) sound as it is being recorded.
I have set up the AVAudioSession property to playandRecord... but I dont know how do I program the following sort of scenario?
Like you have your head phones on and you are walking,some one beeps at you, but u can't listen because of your headphones on, but what if your iPhone captures that beep and plays right away.
If i am recording and playing on the same file at the same time. Will that be a problem?
Any help regarding this would be anticipated.
No there is no problem in that. recording and playing on the same file at the same time

How to use AVAudioPlayer to play a playlist in iPhone/iPad

Please I know how to play a sound in AVAudioPlayer but I would like to know how to give it a list of on-disk files to play one after the other (play list)
Anyone has any idea?
You have to manage this by yourself, using the 'audioPlayerDidFinishPlaying' method to know when the current song is over, and when to start a new one.
The Apple "AddMusic" sample program does exactly this, setting up a playlist of audio files using MPMusicPlayerController and AVAudioPlayer to do most of the work.

How to play next video in MPMoviePlayer?

I have implement an application.In which there is list of videos.when user touch on the video then video play in MPMoviePlayer.But when video is finished then i want to play another video automatically.Is it possible?
Yes. Do you want it to play another one randomly? You could do that. Or do you have an NSArray that contains all the different MPMoviePlayer URLs to play in order? If you do, then loop through the array objects and play each. You will have to have a MPMoviePlayerPlaybackDidFinishNotification to know when each videos finish so you can start the next one.