iPhone SDK: play a sound with coreAudio - iphone

So far i've been using AudioServices to play sounds in my drum app which caused horrible lag etc.
I've been told that if i use coreAudio there will be no lag abd the performance will be better.The person also told me that AudioServices is only used to play short alert sound.
Any idea where i could start with CoreAudio?
If you have any code, it's helpful too :) but tutorials would be better :D.
Thanks in advance!
-DD

I really recommend Apple's documentation and the sample apps they provide:
Core Audio Overview
Audio Unit Hosting Guide for iOS
Example Apps
Audio Mixer (MixerHost)
oalTouch
SpeakHere
iPhoneMultichannelMixerTest
iPhoneMixerEQGraphTest
MusicCube

Related

iOS Raw Video Capture - Where to start?

It's easy enough to use the system-supplied user interfaces for taking pictures and movies on supported iOS devices. How do I do raw video capture and manipulation in iOS 3 and iOS 4? I'm looking for the names of the relevant classes and methods, and possibly a tutorial or reference from Apple...
You can look at these place
AVCam sample
How to Play, Record, and Edit Videos in iOS
Audio & Video Starting Point
AVCaptureSession preference
Wrapper library by Andrew
If you're looking for tuts, there are a lot here.
There good start from Apple with a lots of links that can help. See Audio & Video Starting Point.
You can't do raw video capture on iOS anymore (there used to be hack for iOS3, but now that's it's official in iOS4, they disallowed the hack).
And on iOS 4 - I believe this is the best start:
http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/03_MediaCapture.html
(Read a little, then browse to Processing Frames of Video)
Cheers,
Oded.

AVCaptureVideoDataOutput on iPhone 3G?

Does the iPhone 3G supports the functions of the AVCaptureVideoDataOutput class? Or is it limited cause of the lack of the video feature?
Yes it does, it runs on 4.0 and higher. Here's some (buggy) Apple sample code AVCam to run and play with. Also, if you're thinking of making something serious, here's a nice post explaining what's wrong and can be done better and simpler with AVFoundation framework.

Play MP3 audio data on iPhone

I need to play mp3 audio data in iPhone continuously. I am getting continuous mp3 data via server in iPhone. Now I need to play this data in iPhone. I cannot access url to play as it is of mms protocol. So, for playing this type of data which is the best method to use. Can anyone help me out with this thing.
Thanks in advance.
You have a few options sanctioned by or directly from Apple. You should look into:
Core Audio and the Audio Toolbox
The AVFoundation Framework
The OpenAL Framework
Also, you can try Matt Gallagher's AudioStreamer class. It should be able to do the job, or at least help you figure out how to do so, if you look at the code.
Between those four options, there should be something to help.
NOTE:
After writing this, I did a bit of Googling and I found this thread that discusses the possibility of streaming MMS media to iPhone. It appears that it is not possible, due to the cost of a license from Microsoft. In theory, the above-mentioned frameworks should do everything you need, but it seems that you cannot because of the licensing issue.
Good luck!
audioPlayer = [[AVAudioPlayer alloc]initWithData:<#(NSData )data#> error:<#(NSError *)outError#>];
try this else tell me more clear what you want to do

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/

Playing Audio on the iPhone

I want to play prerecorded audio for users in an iPhone application. Is the best way to play this audio to use openAL? Is there any other way that might be beneficial for what I want to accomplish?
Thanks!
Joe
For most needs, I've found AVAudioPlayer to be an excellent choice for audio playback.
OpenAL covers most audio cases nicely and it is tied to the Core Audio so playback speed is never lagged. Based on what details you gave, OpenAL will take of your needs