Re: stability of AudioBufferSourceNode.playbackState, and activeSourceCount

> We can fire an event once for each node that finishes its input (or consumes its buffer in the case of AudioBufferSourceNode.)  Would that address your concern?

If it 1) works for internal nodes within a graph (i.e. nodes that receive input from one or more sources) and 2) fires after all upstream sources become inactive without requiring the programmer to separately track the state of these sources, then yes, that would address my concern. To go further, I'd say it's my preferred approach.

>  
> A more general event triggered (eventually) on active source count reaching zero for any audio node might be more useful.
> 
> If we send a finished event once per node, this can be implemented in the script by just having a counter, right?

If a "finished" event is fired for internal nodes like mixers, filters, etc, is there a need for a counter? The dispatch of the event would imply that all sources upstream of the target node are now inactive. So to clean up an entire subgraph (which is an important use case) one simply attaches a listener to the output node of that subgraph (which presumably feeds into some higher-level destination that doesn't get cleaned up).

I think the counter idea gets messy if you have subgraphs that are more complex than simple assemblies of buffer sources.

>  
> For starters what if the spec is just loosened so that the change in state is not guaranteed to be immediate? Lets also think separately about how events might assist on graph cleanup...
> 
> Well, making the state updates not immediate addresses the performance concern that I have, but I still think that this is a useless attribute to support, but if crogers doesn't want to remove it because of backwards compatibility concerns, then this is the least we should do to make this efficiently implementable.

Sounds like Chris is OK with removing it -- I was just looking for the minimal change that would address the problem you identified but I don't mind if it becomes deprecated.

Best,

.            .       .    .  . ...Joe

Joe Berkovitz
President

Noteflight LLC
Boston, Mass.
phone: +1 978 314 6271
www.noteflight.com
"Your music, everywhere"

Received on Tuesday, 19 March 2013 19:56:56 UTC