Re: how to detect the end of a playing sound ?

Hi all,

I agree with you both, I think that would be a useful feature, but it leads
me to a question. Are there performance implications for creating a buffer
source node, connecting it to context.destination, calling noteOn(0), and
then forgetting about it? As in, would I see improved performance if I
specifically found all samples that were playing, whose buffer has ended,
and turned them off via noteOff or disconnected them from the destination
node?

Aside from that, Jerome, to your question, potentially a better way of
handling your situation would be to load your mp3 buffers, and then create
a new empty AudioBuffer whose length is the sum of your mp3 buffers'
lengths, and just copy each buffer into the new array in sequence. Then you
could push the large buffer into a BufferSourceNode, and even take
advantage of the "loop" parameter. Maybe you'd find that useful?

-Nick

On Wed, Oct 31, 2012 at 7:54 AM, Gabriel Cardoso
<gabriel.cardoso@inria.fr>wrote:

> Hi !
>
> +1 for that.
>
> I also think such an event would be comfortable.
>
> Gabriel
>
> Le 31 oct. 2012 à 12:39, Jerome Etienne a écrit :
>
> > Hello,
> >
> > i would like to play multiple sounds (songs in mp3) one after the other..
> Is there a way to detect the end of a playing sound ? an event endOfSound
> or something like that ?
> >
> > Currently i storing the duration of the currently playing sound, do a
> settimeout which is triggered after this time, when it is triggered, i stop
> the current sound and start the new one... rather clumsy. is there a better
> way ?
> >
> > Jerome
>
>
>

Received on Wednesday, 31 October 2012 19:04:06 UTC