ircam-ismm / node-web-audio-api

Web Audio API implementation for Node.js
https://www.npmjs.com/package/node-web-audio-api
BSD 3-Clause "New" or "Revised" License
96 stars 13 forks source link

Feat: wrap AudioBuffer with JS proxy #90

Closed b-ma closed 6 months ago

b-ma commented 7 months ago

Before

RESULTS:
  - # pass: 115
  - # fail: 23
  - # type error issues: 20

After

(w/ https://github.com/orottier/web-audio-api-rs/pull/463)

  RESULTS:
  - # pass: 145
  - # fail: 13
  - # type error issues: 0
b-ma commented 7 months ago

Just realized there is an issue with startRendering and decodeAudioData which do not return a wrapped object. Need to change the wrapping approach to make it more like a mixin rather than use inheritance I guess (e.g. like AudioParam.js)

b-ma commented 6 months ago

Ok I made the changes, but wpt results are a bit disturbing...

(all are made against rust upstream/main)

npm run wpt -- --filter the-audiobuffer-interface

main (upstream: main)

RESULTS:
  - # pass: 115
  - # fail: 22
  - # type error issues: 21

feat/audiobuffer-proxy (upstream: main)

RESULTS:
  - # pass: 140
  - # fail: 14
  - # type error issues: 0

Which is nice, but if I do

npm run wpt

main (upstream: main)

  RESULTS:
  - # pass: 5398
  - # fail: 624
  - # type error issues: 62

feat/audiobuffer-proxy (upstream: main)

  RESULTS:
  - # pass: 5302
  - # fail: 568
  - # type error issues: 41

Don't really understand, less failing test but less passing test too...

orottier commented 6 months ago

Without looking into it, I just want to comment it is possible to both decrease in success and fail. One newly introduced failure can block many subsequent successes.

I'm using the following trick to digest the results better:

(make sure to run npm run build before)

create file run-wpt.sh and chmod +x run-wpt.sh:

#!/bin/bash
echo $1
echo ~~~~~~~~~~~~~~~~~
node ./.scripts/wpt-harness.mjs --filter "$1" 2>&1 | grep -A 3 RESULTS
echo

dissect the full suite per directory: ls wpt/webaudio/the-audio-api | xargs -I {} ./run-wpt.sh {} check the specific file results in a dir: ls wpt/webaudio/the-audio-api/the-oscillatornode-interface | xargs -I {} ./run-wpt.sh {}

b-ma commented 6 months ago

Ah thanks!

b-ma commented 6 months ago

Ok, finally got it working, it was a bit more complex than expected but paves the way for #84

main

RESULTS:
  - # pass: 5215
  - # fail: 628
  - # type error issues: 68

feat/Audiobuffer-proxy

RESULTS:
  - # pass: 5278
  - # fail: 591
  - # type error issues: 46
orottier commented 6 months ago

Cool!