Re: Please help with Audio Session and RemoteIO AU on iPhone and iPod touch
Re: Please help with Audio Session and RemoteIO AU on iPhone and iPod touch
- Subject: Re: Please help with Audio Session and RemoteIO AU on iPhone and iPod touch
- From: William Stewart <email@hidden>
- Date: Mon, 24 Nov 2008 12:49:07 -0800
On Nov 22, 2008, at 12:35 PM, Inca Rose wrote:
Thanks for your answers.
Pls see inline with [IR]
Thanks
Inca Rose
On Nov 21, 2008, at 11:13 PM, William Stewart wrote:
On Nov 21, 2008, at 10:13 AM, Inca Rose wrote:
Hi;
First of all, sorry for the long post, but I'm stuck for a few
days now.
I'm in charge of writing the VoIP client part of a game for iPod
touch
and iPhone.
First problem:
the CurrentHardwareSampleRate is not alway set to 8000, sometimes it
is, sometimes it remains on 44100
We had some bugs here, fixed in 2.2. But sometimes you won't get
8000, so you have to deal with that
[IR] Can you please specify the fixes ?
Sometimes you would request a sample rate and just not get it for no
good reason. Now, if there is "no good reason" you will get what you
requested.
I should expect to get the prefered SampleRate ?
I have answered this question already. Asking it a different way
doesn't get you a different answer :)
Second Problem:
the CurrentHardwareIOBuffer gets different values every run, some
times it gets very close to 0.002, sometimes it is
0.023... and sometimes it is 0.12.... or 0.018. This makes it
impossible to successfully gets samples from the mic
or send samples to the speaker in a proper manner.
The hardware buffers that we give you should be the same duration,
same number of samples each time. There might be a bit of
fluctation due to buffering if there is an SRC in the path though.
But I think you are not thinking about this in the right way, even
with these fluctuations you are able to get continuous audio
[IR] I'm experiencing different values each time I run the
application. The value is in seconds so the number of samples and
bytes returned in the callback depends on the format.
I'm getting values from 0.0023 to 0.12. The continuity of the audio
is OK. The problem is that I need to get samples at fixed intervals
to be able to have a smooth VoIP session.
For example I need to get samples each 10 millis or 20 millis. I can
deal with samples each 2 milis and buffer them, but I can not get
samples each 100 milis because the VoIP conversation
will have a 0.1 seconds delay and in some environments this wont be
acceptable.
the real problem, and why you are seeing this (which I only realised
later) is that you are expecting an audio unit to deal cohesively with
a compressed audio format (ulaw/alaw). They don't. You need to be
setting your audio format for linear pcm.
I am even surprised that we would even allow a non-lpcm format to be
set here - but from your description it appears to be. This is only
"working" through a happy accident, and certainly not by design. It of
course, raises the very issues that you are describing (because audio
units are not defined to deal with anything but un-compressed audio)
Third problem is with the interrupt callback:
I get the callback for example when I press the mic button ( on the
headset ) on an iPod touch
and music starts to play. My app is still running, but when I press
the mic button again
the music stops playing but the callback is not called again, so I
can
not continue
with the VoIP session because my AudioSession never becomes active
again.
Why would the iPod touch be interrupting you - if you want iPod to
play in the background, then you need a category that allows that -
we don't have one for doing input and iPod at the same time. So,
this is going to be mutually exclusive I think (but I am not
entirely clear on what you are trying to do here).
[IR] For example, if you are in the middle of a VoIP call, using an
iPod Touch with the headset with mic, and press the mic button, the
ipod app will start playing in the background ( not mixing with my
audio, just taking over the Active Audio Session ).
No, it should not do that because you should have a category that
would preclude iPod from doing this. We'll try this scenario; it
really isn't behaving as I would expect it too.
Bill
_______________________________________________
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