From: stevebvt <ste...@gm...> - 2008-04-14 14:17:11
|
it's not a case of buffer overrun what i was talking about was in the case of OutputBuffer full it seemed that (since there was only 1 OutputBuffer) that sound N+1 would overwrite sound N until the last sound was reached (which i considered problematic) please explain the usefulness of the current functionality (clearly i'm missing it) if i want to play N sounds (for example dtmf tones) & there is no way to tell when a sound ends how do i send N distinct tones? steve ----- Original Message ----- From: "Peter Grayson" <jpg...@gm...> To: "stevebvt" <ste...@gm...> Cc: <iax...@li...> Sent: Monday, April 14, 2008 10:01 AM Subject: Re: [Iaxclient-devel] iaxc_play_sound > Hi Steve, > > On Thu, Apr 10, 2008 at 11:24 AM, stevebvt <ste...@gm...> wrote: >> >> >> i have a question regarding multiple calls to iaxc_play_sound >> (without waiting for a prior call to complete >> by the way - is there a way to determine when a call to iaxc_play_sound >> has >> completed?) > > There is nothing in the API to know when a sound has completed. The > api would have to be extended somehow to have this functionality. As > it stands, iaxc_play_sound() has a fire-and-forget semantic. > >> i would have expected it to work this way >> (given the case of a call to iaxc_play_sound - where a prior call has not >> completed) >> >> 1. the new iaxc_sound{} would be added to the end of the existing chain >> of >> iaxc_sounds (fifo) >> using iaxc_sound.next >> 2.when the current iaxc_sound completed the next iaxc_sound would become >> the head of the fifo queue & output >> >> what the code sees to do is >> 1. the new iaxc_sound{} is added to the front of the existing chain of >> iaxc_sounds (lifo) >> pa_play_sound () - >> sound->next = sounds; >> sounds = sound; >> 2. if there is BUFFER OVERFLOW subsequent iaxc_sound{} data seems to be >> discarded >> pa_mix_sounds () - >> if ( *sp ) /* don't advance if we removed this member */ >> sp = &((*sp)->next); >> >> what should happen in this case? > > The way iaxc_play_sound() works is to play each sound as soon as > possible. If there are multiple sounds in the "sounds" list, then they > are played at the same time and mixed together (see mix_slin()). This > is why it doesn't matter whether the sounds are prepended or appended > to the sounds list. > > I do not see any potential buffer overflows in pa_mix_sounds(), but I > could be missing what you are seeing. Could you give a little more > explanation of where a buffer may be overrun? > > Pete |