Re: generating sound on iPhone/iPad
Re: generating sound on iPhone/iPad
- Subject: Re: generating sound on iPhone/iPad
- From: "Hank Heijink (Mailinglists)" <email@hidden>
- Date: Mon, 8 Feb 2010 10:03:58 -0500
> The problem is that I need to generate real time audio myself. I will calculate each next sample using a sound algorithme.
> I think the preferred method is using Audio Units. But it is not clear to me if this can be done on the iPhone.
> There are Audio Units in iPhone but can I define my own?
> Some documents talk about using openAL, But this seems a lot of overhead for my needs.
You could use either Audio Units (the Remote IO unit would work for you - no need to define your own, which you can't on the iPhone) or the Audio Queue. In both cases you register a callback that fills the audio buffers, and you're free to fill those with your own generated sound. One thing to keep in mind is that the audio queue uses signed 16-bit integers and audio units use 8.24 fixed point format. The advantage of using an Audio Unit is that the latency is lower and the quality higher, but it's a bit more involved to set up (although not much, imo).
> My sound generation algoritme is flexible. I can generate more detailed sounds when processing power is available.
> I would like to use that to automatically adapt to the available processing power.
> For instance making it such that I never use more then 50% of the processor time so that enough processing power will be
> available for other things (like the GUI). Is that possible? Is there for instance a main clock count that I can use to time my
> algorithme?
This I don't know, but maybe others will weigh in on this. I'd start by profiling your ideal situation to get a sense of how things stand. It might not be necessary to compromise at all.
Good luck,
Hank
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden