views:

8987

answers:

6

I'm trying to learn how to handle audio at a fairly low level with audio queue services.

I have been progrmaing in memory managed languages for quite a while, and have just completed the c programing tutorial by vtc (2007).

This has left me comfortable with the understanding of pointers and memory allocation, but the apple documention still leaves me wanting for a simpler implenation and explaination.

Maybe I need to learn objective c and cocoa better.

I have heard that this book is good.

Cocoa(R) Programming for Mac(R) OS X (3rd Edition)

Could someone suggest a learning path that is going to help me get an better understanding of working with audio and an iphone.

I want to be able to play mp3 files back and also alter the pitch of them as they are playing. I am prepared that I may have to temporarily convert the mp3 files into pcm files to do things like that to them.

A: 

The sample code SpeakHere (Developer Connection membership required) for iPhone demonstrates using Audio Queue services to record and playback sound. I'm not sure that MP3 is natively supported, you may have to transcode it to a form acceptable to iPhone...

Jared Oberhaus
+4  A: 

Could someone suggest a learning path that is going to help me get an better understanding of working with audio and an iphone.

I’d suggest that You start with a higher-level API, because Audio Queue Services have quite a lot of quirks and will give You a lot of trouble, especially if You are just starting out.

I want to be able to play mp3 files (…)

This one is easy, take a look at the AVAudioPlayer class.

(…) and also alter the pitch of them as they are playing.

AVAudioPlayer can’t do that, but you can change the pitch quite easily using OpenAL. See the Finch sound engine for sample code.

zoul
I wanted to agree with zoul. This is not a beginner project that is being described.
mmc
+6  A: 

CoreAudio is really difficult; I'd say it's the most difficult API I've tackled on Mac OS / iPhone. If you've just started learning C / native code programming, I think that (no respect) you might be biting off more than you can chew.

There is basically no good documentation or tutorial code. That's part of what makes it hard. The Apple sample code is helpful, but you really have to put in some time with it, taking it apart and changing things around, to be able to understand it.

(Also, this has nothing to do with Objective-C or Cocoa. The CoreAudio API is pure C, and the Apple sample code is mostly C++. You don't need to know any Objective-C to write audio code.)

Note that AudioQueues won't let you access all the functionality of Core Audio. They're meant to be easier to use (relatively), but they have much higher latency, and you can't do audio processing, like time-shifting that you mentioned. To do this, you need to use AudioUnits, which are a lot more complex.

I would really, really urge you to tackle something that isn't so hairy, until you get more used to lower-level native programming. Audio development has been very frustrating for me, and I've been using C/C++, and developing for Macs, for 20 years...

Jens Alfke
I think you wanted to say was: *(no disrespect)
Eric Brotto
A: 

@optician Did you manage to receive that free library for audio services from Pablo, as he mentioned below? I'd like to have a look at that library too if it's possible.

"I can give you a free library to use Audio Services on iPhone if you want. Haven't found any decent tutorial/documentation on what you are asking though... – Pablo Santa Cruz Apr 17 at 17:55 "

A: 

if any one have a code about audio player let me know please because i need this code .. SpeakHere do not work with me why ?! do not know , thanks for help SaebNajim

saebnajim
A: 

I also start to study audio development in iPhone. The good start point, I have to start from which, is SpeakHere example.

Here are two stories maybe you will have interest:

1 SpeakHere sample can’t play sound which loads from internet

2 SpeakHere Sample Code Bug and Work-Around

Forrest
Are those supposed to be links? You didn't link to anything.
Peter Hosey
just google with the key words I put here.
Forrest