Re: Other comments on Web Audio

On Fri, May 11, 2012 at 4:27 AM, Raymond Toy <rtoy@google.com> wrote:

> On Wed, May 9, 2012 at 6:19 PM, Robert O'Callahan <robert@ocallahan.org>wrote:
>
>>
>>
>>> AudioBuffer createBuffer(in ArrayBuffer buffer, in boolean mixToMono)
>>>
>>>
>> boolean parameters are generally a bad idea. E.g. reading
>> "createBuffer(buffer, false)" the casual reader will have no idea what the
>> boolean means. If it's not too late to change this, please change it.
>>
>
> What would you suggest?
>

A mixToMono attribute on AudioBuffer?

If you think you might want more options on createBuffer, a WebIDL
dictionary type so authors would write createBuffer(buffer, { mixToMono:
true}).

Why isn't numberOfChannels on audioNode?
>>
>> What use is numberOfOutputs since you don't actually provide any kind of
>> access to the outputs?
>>
>> Is there a use for numberOfInputs other than just looping to disconnect
>> them all? If not, why not just add a disconnectAll method?
>>
>
> Are you referring to the AudioNode description?  Doesn't the connect
> method allow you to specify which of the audio nodes outputs can be
> connected to the input of the destination?
>

Yes, but if you are assigning to a particular input then you probably
already know how many inputs there should be.


> I still think a.connect(b) obscures which of 'a' and 'b' is the
>> destination, but I suppose we're stuck with it.
>>
>
> I'm curious to know what you would suggest.  I think it makes some sense
> if you read it as a is connected to the input of b.
>

Sure, but the problem is you can just as easily read it as "a is connected
to the output of b".

In AudioParam, what are 'minValue' and 'maxValue' useful for? I'm unsure
>> about 'name' and 'units' too.
>>
>
> I don't think minValue and maxValue are actually used for anything other
> than a hint to the user.  I don't think there is any check made if you set
> a value outside of these values.  The same goes for name and units.  The
> name could be useful if you have a large dynamic list of AudioParams that
> you might want to distinguish by name instead.
>

Authors can always attach expando JS properties to DOM objects, so they can
assign their own 'name' attribute if they want to, without it being in the
spec.

Given what you've said above, I think these should be removed from the spec.

Rob
-- 
“You have heard that it was said, ‘Love your neighbor and hate your enemy.’
But I tell you, love your enemies and pray for those who persecute you,
that you may be children of your Father in heaven. ... If you love those
who love you, what reward will you get? Are not even the tax collectors
doing that? And if you greet only your own people, what are you doing more
than others?" [Matthew 5:43-47]

Received on Thursday, 10 May 2012 21:45:08 UTC