I'm introducing a functionality in my iPhone app that allows user to mix and play selected audio files.
What is the difference between just using two AVAudioPlayer to play the music files concurrently versus using Apple's example class, MixerHost, to play the files?
The class MixerHost can be found on here:
http://developer.apple.com/library/ios/#samplecode/MixerHost/Listings/Classes_MixerHostAudio_h.html
MixerHost gives you much more precise control over the relative timing of the two audio inputs.
Related
I am creating one application which requires recording voice and then funny voice will play.
Is there any library to use this work function better?
The SpeakHere sample application provided from the SDK site has a working example of how to use the microphone to record the voice.
Now how to play funny voice.
For that there are no built-in iOS APIs that will do independent time-pitch modification.
There is open source code that implements time-pitch stretching in Audacity, but I don't know whether this code has been ported to iOS. Same with SoundTouch.
There is a Time-Pitch Stretch Tutorial on the DSP Dimensions site.
Some more blogs on it
http://purplelilgirl.tumblr.com/post/9377269385/making-that-talking-app
http://maniacdev.com/2011/08/tutorials-how-to-change-pitch-instantenously-without-changing-tempo-like-the-talking-tom-app/
http://dirac.dspdimension.com/Dirac3_Technology_Home_Page/Dirac3_Technology.html
I want to record audio that is played by my application in a file. does somebody have any idea to do that? it is also achieved in talking tomcat application.
There are two ways to record and play an audio file on an iPhone:
You could use the standard Core Audio Framework which is provided in Objective-C and C Code.
Or what probably would be easier is using the only in IOS available AVAudio* Classes.
Have a look at the AVAudioRecorder class. Its pretty simple to use and if you google for this class name you will find plenty of example code:
API - AVAudioRecorder
I currently have 3 ways to play audio within my app:
Using AudioServicesPlaySystemSound for vibration and simple
sounds
Using Audio Toolbox for bundled files (3rd party class)
Using AudioServices with AudioFX
What I'm currently investigating is, if I can play other kinds of audio that are already present on the iPhone. I would like to reduce my app's download size, as well as offer more flexibility in terms of the kind of sound that the user can play.
Can I play from within my app:
Audio recordings from the Voice Memos app, or do I have to
create my own recordings? Items from an iPod playlist or Music app?
Items from youtube by pre-loading them, or will I have to stream them every time?
Existing ringtone for the phone?
I am a complete beginner when it comes down to playing audio on an iPhone and am already using two 3rd party classes for audio tasks.
Is there an easy way to accomplish some of the tasks listed above?
1) Audio recordings from the Voice Memos app
It's been asked before and I don't believe it's possible from your app sandbox.
iPhone: Access voice memos programmatically
2) Items from an iPod playlist or Music app
There's an API for that, the iPod Access Library:
http://developer.apple.com/library/ios/#documentation/Audio/Conceptual/iPodLibraryAccess_Guide/Introduction/Introduction.html
3) Items from youtube
Should be possible, using a UIWebView.
http://iphoneincubator.com/blog/audio-video/how-to-play-youtube-videos-within-an-application
4) Existing ringtone for the phone
No, you can't access the current ringtone programatically.
How can I programmatically determine the default ringtone on an iPhone?
You can download sound files on first start (not in your didFinishLaunchingWithOptions method or your app will likely be killed) and save them locally, then you can just play them when needed. You can play files in their iTunes library, but won't know what they have in the library.
To play from their library, this is a handy example:
http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-music-library-access/
You can also record user input from your app with AVAudioRecorder, save that and then play it whenever.
I am developing one application. In that I want to record the sounds and I want to play that recorded sound file. I know the frameworks for doing this. But how to develop programmatically by using that frameworks?
You can refer to this link:
I have implemented this code in one of my apps and it works completely fine.
How do I record audio on iPhone with AVAudioRecorder?
For Playing the sound you have option to use AVAudioRecorder.
Hope this helps.
The best way to do it - and I am talking from painful experience here - is with the RemoteIO audio unit. You can also do it with AudioQueue, but it has a higher latency, and the queue type approach becomes very problematic.
So, I think that they are really different tools for different jobs. Note that you won't play a sound file as such. You will play the contents of a buffer held in memory. As long as the buffer is not too large, this should not be an issue.
So, going with RemoteIO, you will find this blog and tutorial very useful. It includes code samples.
Using RemoteIO audio unit By MICHAEL TYSON
Can iphone mix two sound files or build custom equalizer?
I have studied for weeks about this problem,
and it seems unable to use iphone-sdk to mix two or more sound files or to build custom equalizer.
Is anyone have the experience to do this?
Yes you can. AVAudioPlayer can play multiple sounds and you can control the volume for each. Or you can use Audio Units and have more control over the audio data.
aurioTouch is a good sample app for what you are thinking of.
For simple playback of sound files you can use the AVAudioPlayer class introduced in the 2.2 SDK. It provides playback and volume controls for playing any audio file. As far as I am aware, there are no restrictions on the number of sound files you can play on the iPhone. The only restriction on playing sound files is that you may only play one AAC or MP3 compressed file at a time, the rest of the files must be either uncompressed or in the IMA4 format.
If your needs are more low-level (If you need to do DSP) you might want to look at AudioQueue Services or AudioUnits - two Mac OS X audio processing APIs that are also available on the iPhone.