Re: [webaudio-tests] [Web Audio] Added Audio API tests: MediaElementAudioSource interface (#396)

Needs review (possibly by @chrislo)

1. Implemented testing the MediaElementAudioSource node output by two ways:
  * OfflineAudioContext - script is less straight forward, but some implementations (Firefox) do no support createMediaElementSource on an offline context
  * ScriptProcessor node
   
  It should be possible to combine two methods to a single test file.

2. Timing precisely the start/end time of the source node samples is problematic. Using the media events (i.e. playing/eneded) is not precise enough and might miss samples.

Achieved it by trimming expected/actual sample arrays for trailing/ending empty samples.

3. I'm not sure the behavior of a MediaElementAudioSource in relation with OfflineAudioContext is well defined. Should the output be rendered live or sample by sample (i.e. if there's  a pause in the streaming, what should be the input for context.destination)?

I think this might be the reason that Chrome implementation sometimes fails and sometimes passes. 

4. Included tests for just the beginning of the recorded data, since some (all?) implementations contain some unexplained noise in the end of the output using OfflineAudioContext.

5. Not using the harness setup() method, since it hides errors and considering the setup phase optional.

6. Not using the harness test.step, but separate test(), since it is valuable to see which steps failed separately, and using step(), they are all under a single test (i.e. one fail => all fail)

Thanks,
Amitay


View on GitHub: https://github.com/w3c/web-platform-tests/pull/396#issuecomment-27497884

Received on Thursday, 31 October 2013 15:52:25 UTC