W3C home > Mailing lists > Public > public-audio@w3.org > October to December 2012

Re: [Web MIDI API] send() timestamp

From: Jussi Kalliokoski <jussi.kalliokoski@gmail.com>
Date: Fri, 14 Dec 2012 21:55:02 +0200
Message-ID: <CAJhzemV8Nvmf4D5XhqvxKpbmrvTM63OfSg9AO4PnhLo5GGfgRw@mail.gmail.com>
To: Marcos Caceres <marcos@marcosc.com>
Cc: public-audio@w3.org
Hi Marcos!

On Fri, Dec 14, 2012 at 9:24 PM, Marcos Caceres <marcos@marcosc.com> wrote:

> Hi,
> I'm a bit confusedů why does the API require a timestamp relative to some
> time (i.e., performance.now())? For example:
>

This is to maintain symmetry with incoming messages, which have relative
timestamps, e.g.

// proxy
input.onmessage = function (e) {
  output.send(e.data, e.timestamp)
}

Cheers,
Jussi


>
> output.send(data, performance.now() + time);
>
> It seems to me that it would be better to just let the second argument be
> a delay (as a high resolution timestamp):
>
> //wait a few millis
> output.send(data, millis);
>
>
> The problem is that timestamps in the past always resolve to 0 (i.e., play
> now!), so seems kinda pointless to rely on a timestamp.  What am I missing?
>
> --
> Marcos Caceres
>
>
>
>
Received on Friday, 14 December 2012 19:55:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:03:14 UTC