Re: Basic AudioQueue Service issue
Re: Basic AudioQueue Service issue
- Subject: Re: Basic AudioQueue Service issue
- From: Alex Kac <email@hidden>
- Date: Wed, 22 Oct 2008 19:58:51 -0600
On Oct 22, 2008, at 7:02 PM, William Stewart wrote:
I understand your frustration.
However, we can't fix bugs if we are just going to get random
comments about "i've tried this and blah happens". I know that
sucks, but we aren't prescient.
But its not necessarily bugs I think he's talking about - just better
documentation. I would agree with that. I've had the exact same
identical issues with AudioQueues. I have figured out most of it, but
some of it (like pausing recording or playing) was done with code that
I know is probably too much.
A good procedure to follow is to have an example - lets say you
start with speak here or aqplay - and you modify it in some way to
do what you want it to do. it doesn't work. A simple post to
describe what you tried to do and why it didn't work is not a bad
starting point. If we get to the point that what we think you are
doing should work, then we would have you file a bug and attach some
code so that we can see the problem happening and then understand it.
I really have no idea what to do with these kinds of complaints
though - I know it sounds obvious to you, but to me what you have
changed/done to do this is completely opaque.
The basics would be nice:
I have an audioqueue playing or recording. How do I properly:
1) Pause
2) Restart playing/recording
3) Seek to a specific position
4) Get the position in human readable time format
5) Append audio to an existing recording
I've figured out most of this over a long time and a week or two of
working through things - but some of it is definitely more cumbersome
code or not perfect. I'd like examples for all of these things based
off SPeakHere code so I could compare what I ended up with myself.
Bill
On Oct 20, 2008, at 8:33 PM, Craig Patchett wrote:
I'm trying to do the same thing and am having all kinds of
problems. Would it be possible for someone to provide a code
solution or a summary of what changes need to be made in order to
replay a queue without reinitializing it? Specifically:
- How to restart a queue after it has finished playing
- How to restart a queue that is currently playing
It seems like it should be simple to do, and perhaps it is for
someone with a lot of experience with CoreAudio, but finding the
right combination of method calls is approaching black magic for
me! Specifically I've run into the following problems:
- No sound after the queue has played all the way through (like
Romain describes)
- The sound not playing properly the second time through (usually
with an echo of some sort)
- Various crashes and freezes that seem to be related to locking
issue
- A pop when the sound is restarted during playback
I've come up with various combinations of ideas that end up
resolving one or two of these problems but have yet to come up with
something that solves them all. I've spent enough time in both the
SpeakHere sample code and the AudioQueue guide sample code that I
understand what's going on in the code, but the behind-the-scenes
behavior of the various AudioQueue calls seems to be what's giving
me trouble.
I've spent more time than I care to admit trying to come up with a
solution to this and would really appreciate any help. At this
stage I'm even willing to put my money where my mouth is and offer
$100 for a working, coded solution.
Thanks.
Craig
On Oct 20, 2008, at 11:08 AM, Romain Pechayre wrote:
Hello,
I am new to CoreAudio Programming and I have a problem with an
AudioQueue. I use it to play a simple short sound but I need to
control the volume, that is why I don't use SystemSounds instead.
I am trying to play an audioqueue without having to initialize it
from scratch every time I use it. For example, I don't want to
open the associated file every time I play the sound.
To do so, I have tried to customize the playBackCallback function
from SpeakHere iPhone sample code. It is pretty much the same as
the one used in AudioQueue Services Programming guide. I have just
set mCurrentPacket to 0 every time I call the callback function.
It seems to work well because it reads the same number of packets
with audiofileReadPackets everytime I call it. The problem is that
the sound is actually played only when I call AudioQueueStart for
the first time.
To be more specific, I have a button that is supposed to play a
sound when I press it. It works when I press it for the first time
but it does not as of the second time. I have tried debugging a
number of parameters including everything I could in the callback
function, and the behavour seems to be the same except that the
sound is actully played only at the first attempt.
I was therefore wondering if is technically possible to play an
AudioQueue again and again without having to initialize it from
scratch ( which means calling
CFURLCreateFromFileSystemRepresentation and AudioQueueNewOutput ).
I hope the formulation of my question is not too bad and you will
be able to help me.
Kind regards
Romain Pechayre
_______________________________________________
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
Alex Kac - President and Founder
Web Information Solutions, Inc.
"If at first you don't succeed, skydiving is not for you."
-- Francis Roberts
_______________________________________________
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