diff options
Diffstat (limited to 'testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/processors/timing-info-processor.js')
-rw-r--r-- | testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/processors/timing-info-processor.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/processors/timing-info-processor.js b/testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/processors/timing-info-processor.js new file mode 100644 index 0000000000..714e32dbb5 --- /dev/null +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/processors/timing-info-processor.js @@ -0,0 +1,25 @@ +/** + * @class TimingInfoProcessor + * @extends AudioWorkletProcessor + * + * This processor class is to test the timing information in AWGS. + */ +class TimingInfoProcessor extends AudioWorkletProcessor { + constructor() { + super(); + this.port.onmessage = this.echoMessage.bind(this); + } + + echoMessage(event) { + this.port.postMessage({ + currentTime: currentTime, + currentFrame: currentFrame + }); + } + + process() { + return true; + } +} + +registerProcessor('timing-info-processor', TimingInfoProcessor); |