Re: [web-audio-api testing] Best way of testing an AudioNode output

Hi,
Created tests using both ScriptProcessor and OfflineContext as output
target, feel free to review it at
https://github.com/w3c/web-platform-tests/pull/396 . Commented the pull
request (which needs review first with the reason behind using both
methods).

Some spec related questions which I wasn't sure about:

1) Is there a fine grained (i.e. single sample accuracy) to test when
output from a (MediaAudioElement) source node started and ended? Using the
media events (
https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Events/Media_events)
doesn't see to provide this precision.

2) Noticed while testing that Mozilla Firefox (27 nightly) does not send
any output from a MediaAudioElementSource when the audio source is not from
the same origin (i.e. different domain). Is this by any way a correct
behavior? (The current tests are all under a single domain, so it doesn't
fail in the part).

3) I'm not sure the relation between an OfflineAudioContext and a
MediaAudioElementSource is well defined (or maybe for any streaming
source). Should the input for the the offline context destination node be
live, or sample by sample? For example, when there is a pause in the
playback, should the rendered output contain zero-valued samples, or just
actual input samples?
This might be the reason for interchanging pass/fails I get in Chrome for
some of the tests.


Thanks,
Amitay


On Mon, Oct 28, 2013 at 10:53 AM, Chris Lowis <chris.lowis@gmail.com> wrote:

> Hi Amitay,
>
> Thanks for taking a look at this. The approach we decided was to use
> OfflineAudioContext, but to generate the expected output in pure
> javascript where possible (for example, the expected output of the
> OscillatorNode set to generate a sine wave would be compared to that
> generated using Math.sin()) rather than using wav files to contain the
> expected output.
>
> Using OfflineAudioContext allows the tests to run faster than real time.
>
> MediaElementSourceNode might be a bit tricky to test. The Web platform
> tests have a mechanism for serving up test files, so perhaps we could
> use a file delivered through an <audio> tag, compared to the same file
> loaded into an audiobuffer?
>
> Any questions, please ask away - or if you'd like to work on some code
> together, submit a pull request to web platform tests and I can take a
> look.
>
> Cheers,
>
> Chris
>
>
> On 26 October 2013 21:40, Amitay Dobo <amitayd@gmail.com> wrote:
> > Hi,
> > I'm trying to come up with a test for expected
> > MediaElementAudioSourceNode  output behavior.
> > However, I'm not sure what is the preferred way to test it as a unit,
> > without testing other components as a side effect.
> >
> > Some approaches:
> > 1) Using OfflineAudioContext as in the current Web Platform Audio test
> > (
> https://github.com/w3c/web-platform-tests/blob/master/webaudio/the-audio-api/the-gainnode-interface/test.html
> )
> >
> > 2) Using an Analyser node (preliminary test at
> http://jsfiddle.net/UbHHr/8/)
> >
> > 3) Using a ScriptProcessor node (preliminary test at
> > http://jsfiddle.net/Jqmr2/12/ ).
> >
> > I want to to limit as much as possible depenencies in other components.
> > Would be happy to hear your thoughts and suggestions.
> >
> > Cheers,
> > Amitay
> >
> > P.S. This is a test I find important right now, since In firefox
> > nightly and older webkit browsers (i.e. Safari 6) connecting a
> > MediaElement source to either ProcessorNode or AnalyserNode does not
> > yield expected results.
> >
>

Received on Thursday, 31 October 2013 16:07:46 UTC