Re: AudioContext suspend/resume/release

On Mon, Sep 29, 2014 at 9:59 AM, Chris Wilson <cwilso@google.com> wrote:

> On Mon, Sep 29, 2014 at 9:39 AM, Raymond Toy <rtoy@google.com> wrote:
>
>> On Mon, Sep 29, 2014 at 8:54 AM, Chris Wilson <cwilso@google.com> wrote:
>>
>>> On Sat, Sep 27, 2014 at 1:43 PM, Jonas Sicking <jonas@sicking.cc> wrote:
>>>
>>>> What is the purpose of returning a Promise? I don't particularly mind,
>>>> but given that this is a function to save resources, why incur the cost of
>>>> an extra object creation?
>>>>
>>> Hmm.  I believe I did this because it will sometimes be desirable to
>>> know when the audio device has been actually released - i.e. one can create
>>> another audio context.  Raymond?
>>>
>>
>> I'm not 100% sure, but I think there is potentially some (small) delay
>> between when I ask to stop the audio hardware and when the resources are
>> actually released.  I'm not sure either if we have the infrastructure in
>> place if we can even be told this.
>>
>> And it's really about the HW resources associated with the context, not
>> the extra objects that might be created in JS.
>>
>
> Jonas' point was we're creating an extra JS object, for no apparent
> reason.  If we can't be informed when the audio resources are actually
> released, let's remove the promise and just return.
>

That's ok with me. I have not yet investigated whether we have that info or
not or how easy it would be to get a notification. I think it might require
a process hop from browser to the renderer to turn off the HW.

Received on Monday, 29 September 2014 17:03:35 UTC