Recording sounds created within an iPhone app - iphone

I'm new to programming in Objective-c and the iPhone but I am working on an app to teach myself. I have been trying to figure out how to record sounds on the iPhone. Apple provides excellent documentation for recording from the microphone with AVAudioRecorder but I want to record sounds made by my app, or even just record sounds when buttons are pressed (button is pressed, certain audio gets recorded).
I have no clue how to do this and can't seem to find anything that would help me along this path, only microphone stuff.
Can anyone share ideas or code that would make this possible?
Thanks

Once you move beyond the convenience classes like AVAudioRecorder, you've got a lot of studying to do.
I would start with:
Getting Started with Audio and Video
Multimedia Programming Guide:Audio
Core Audio Overview
Audio programming is a very large and complex subject. If you want to customize, be prepared to spend some time learning it.

I've made a sample app that records sounds/audio and has a playback. Hope this helps! https://github.com/casspangell/AudioMic

Related

Custom audio control for ios apps

We are creating an app using Swift on IOS that needs to use custom audio controls: a play button, a stop button, a current time/pos indicator, the duration and perhaps even a seek bar to play 1 audio file that is built into the application. My friend has worked hard on this project but so far was unable to find a solution. Is it possible using mediaplayer or is another api easier, possibly something similar to exoplayer for android apps.
Thanks.
In my opinion I would say that using AVFoundation would probably be easiest since it is built into swift you just have to do import AVFoundation and you would probably want to create an AVAudioPlayer to listen to the music. Also the API is pretty simple. If you need any help getting started I found this article on Mashable that shows how to play audio and how to control it with a custom play and pause button. https://medium.com/yay-its-erica/creating-a-music-player-app-in-swift-3-53809471f663. Also I found on Apple's documentation how to get the current time of the audio playing https://developer.apple.com/documentation/avfoundation/avaudioplayer/1387297-currenttime. I hope I was able to help and if you have anymore questions don't hesitate to ask!

how to play background music while recording voice?

friends
Now I'm developing iPhone Recorder App.
I can easily record my voice with sample code.
I want to record background music with my voice.
For example,When I click "Record" button,background music plays
Then I sing a song.
In this case,I should record background music with my voice.
But,If I did like that,I can't record anything.
What's wrong?
To do this,what should I do?
Please help me..
Thanks.
I'm not familiar with programming for the iPhone but I can imagine there would be a limitation to what you like to achieve IF you intend to make this work without using headphones/headset. It just might be that the OS wont let you play music and record at the same time because the recording would result in an echo because of the background music.
That said, I'm sure an experienced iPhone programmer is able to tell you exactly how this would work.
Good luck and I hope my suggestion helps you out.
friends
I solved this problem by using OpenAL.
Thanks for all your effet.

iPhone: Building talking puppet application

I am trying to learn and build talking puppet iPhone application. The great example is "Talking Ben the Dog" and here is youtube video. I have no idea how am I going to build such application. I have a graphics designer who will do their part. As a being programmer, what would I need to be aware of? If someone can throw their ideas or point me some relavant documentation or sample code would be great help.
Thanks.
First, you'll need to create the content. That means the animation scenes and any associated audio. Next, you'll want to trigger those scenes based upon the user's input.
If you want more advanced functionality like "talk back" where the app repeats what you say, then you'll need to get a grip with AudioQueue and AudioUnit APIs. That means detecting levels of incoming audio then triggering writing audio in to stored buffers. These APIs are difficult so this will be the most technically challenging part. You'll need to be comfortable with pointers and other lower level programming concepts.
For an app without talk back, a lot of work will be required to create the content. Then you'll need to re-create the animations using UIImage and the Core Animation framework in your app.
There are a lot of great videos on the Apple site and sample code. This will be a brilliant learning curve for you to get up to speed with Core Animation.
Just make a couple of videos for every scene and play them according to button click!

How to record sound of a key press on iphone?

I am developing an application in which I want to record the sound of a piano key press. I'm not able to find anything relevant on the internet which helps.
Can anybody share the code or any link which shows how to record the data of the piano key press, store it somewhere in memory and then play it again?
or
If anybody knows how to get the key press event of the keyboard and record it, that would also be appreciated.
Thanks,
Mishal
It sounds like your particular need does not involve MIDI or capturing notes from a digital piano, if I am reading correctly. You want just the audio sound of a piano, to play back on an iPhone app?
A few questions/thoughts:
First, do you just need one note/sound? If so you should be able to easily find a sound file that is to your liking on a site that sells sound samples. I myself use sounddogs.com for various odd projects.
Next, what sort of code do you need to play the sound? What programming language are you developing the app in and how do you trigger the sound playback? These details will be helpful in giving you some ideas.
Finally, if the main obstacle is just finding and recording the sound, this question may be better moved to superuser.com since that site deals more with general computer questions, media, and technology. (StackOverflow is focused strictly on programming.)

Is it possible to both play a sound and record from the microphone at the same time on the iPhone?

I want to both play sound and record sound at the same time on the iPhone.
All the apps which record sound first disable any music playing. However as music would disrupt their purpose I don't know if they're doing this deliberately or whether the iPhone does it automatically when you record from the microphone.
Does anyone have experience with this?
Refer to this page. Good luck!
I've heard something about this on one episode of the mobile orchard podcast - the one with Michael Tyson, the creator of Loopy. During the discussion, Michael explained that he had to include some code to filter out the sounds that were coming in through the microphone in realtime as other sounds were being played on the speaker.
Based on that discussion, it seems entirely possible to both play and record at the same time, but I'm sure you'll have to do your own filtering to avoid recording the sounds your playing.
You can use either a core audio unit or an audio queue, and
you need to make sure that your audio session category is set to kAudioSessionCategory_PlayAndRecord.
Beware that sound output when you use this session is much quieter
than the normal solo session (observed on 3.0).