-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update gh-pages to output generated at b817c71
- Loading branch information
1 parent
1771c3e
commit 996b2be
Showing
31 changed files
with
268 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
tests/playwright/pages/audioworklet-addmodule-resolution.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>AudioWorklet Add Module Resolution</title> | ||
</head> | ||
<body> | ||
<h1>Audioworklet Add Module Resolution</h1> | ||
<p>Test if browser doesn't crash upon addModule() call in realtime and offline context construction</p> | ||
<p>Port of <a href="https://wpt.fyi/results/webaudio/the-audio-api/the-audioworklet-interface/audioworklet-addmodule-resolution.https.html?label=experimental&label=master&aligned">audioworklet-addmodule-resolution.https.html</a></p> | ||
|
||
<script> | ||
const sampleRate = 48000; | ||
const realtimeContext = new AudioContext(); | ||
const offlineContext = new OfflineAudioContext(1, sampleRate, sampleRate); | ||
|
||
const filePath = 'processors/dummy-processor.js'; | ||
|
||
const addModulesPromise = Promise.all([ | ||
realtimeContext.audioWorklet.addModule(filePath), | ||
offlineContext.audioWorklet.addModule(filePath) | ||
]).then(() => { | ||
return new Promise((resolve, reject) => { | ||
try { | ||
// Test if the browser does not crash upon addModule() call after the | ||
// realtime context construction. | ||
let realtimeDummyWorklet = new AudioWorkletNode(realtimeContext, 'dummy'); | ||
realtimeDummyWorklet.connect(realtimeContext.destination); | ||
window.realtimeDummyWorkletLoaded = realtimeDummyWorklet instanceof AudioWorkletNode; | ||
|
||
// Test if the browser does not crash upon addModule() call after the | ||
// offline context construction. | ||
let offlineDummyWorklet = new AudioWorkletNode(offlineContext, 'dummy'); | ||
offlineDummyWorklet.connect(offlineContext.destination); | ||
window.offlineDummyWorkletLoaded = offlineDummyWorklet instanceof AudioWorkletNode; | ||
|
||
resolve(); | ||
} catch(error) { | ||
reject(error); | ||
} | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
46 changes: 46 additions & 0 deletions
46
tests/playwright/pages/audioworklet-addmodule-resolution/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>AudioWorklet Add Module Resolution</title> | ||
</head> | ||
<body> | ||
<h1>Audioworklet Add Module Resolution</h1> | ||
<p>Test if browser doesn't crash upon addModule() call in realtime and offline context construction</p> | ||
<p>Port of <a href="https://wpt.fyi/results/webaudio/the-audio-api/the-audioworklet-interface/audioworklet-addmodule-resolution.https.html?label=experimental&label=master&aligned">audioworklet-addmodule-resolution.https.html</a></p> | ||
|
||
<script> | ||
const sampleRate = 48000; | ||
const realtimeContext = new AudioContext(); | ||
const offlineContext = new OfflineAudioContext(1, sampleRate, sampleRate); | ||
|
||
const filePath = 'processors/dummy-processor.js'; | ||
|
||
const addModulesPromise = Promise.all([ | ||
realtimeContext.audioWorklet.addModule(filePath), | ||
offlineContext.audioWorklet.addModule(filePath) | ||
]).then(() => { | ||
return new Promise((resolve, reject) => { | ||
try { | ||
// Test if the browser does not crash upon addModule() call after the | ||
// realtime context construction. | ||
let realtimeDummyWorklet = new AudioWorkletNode(realtimeContext, 'dummy'); | ||
realtimeDummyWorklet.connect(realtimeContext.destination); | ||
window.realtimeDummyWorkletLoaded = realtimeDummyWorklet instanceof AudioWorkletNode; | ||
|
||
// Test if the browser does not crash upon addModule() call after the | ||
// offline context construction. | ||
let offlineDummyWorklet = new AudioWorkletNode(offlineContext, 'dummy'); | ||
offlineDummyWorklet.connect(offlineContext.destination); | ||
window.offlineDummyWorkletLoaded = offlineDummyWorklet instanceof AudioWorkletNode; | ||
|
||
resolve(); | ||
} catch(error) { | ||
reject(error); | ||
} | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Offline Sine Test</title> | ||
</head> | ||
<body> | ||
<h1>Offline Sine Test</h1> | ||
<p>Write 441Hz sine wave for 1 second to AudioBuffer using OfflineAudioContext, sampleRate: 44100</p> | ||
|
||
<script> | ||
const sampleRate = 44100; | ||
const length = 1; | ||
const numChannels = 1; | ||
const freq = 441; | ||
|
||
const offlineContext = new OfflineAudioContext(numChannels, length * sampleRate, sampleRate); | ||
const osc = offlineContext.createOscillator(); | ||
osc.type = 'sine'; | ||
osc.frequency.value = freq; | ||
osc.connect(offlineContext.destination); | ||
|
||
const bufferData = new Promise((resolve, reject) => { | ||
osc.start(); | ||
offlineContext.startRendering().then((buffer) => { | ||
resolve(buffer.getChannelData(0)); | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Offline Sine Test</title> | ||
</head> | ||
<body> | ||
<h1>Offline Sine Test</h1> | ||
<p>Write 441Hz sine wave for 1 second to AudioBuffer using OfflineAudioContext, sampleRate: 44100</p> | ||
|
||
<script> | ||
const sampleRate = 44100; | ||
const length = 1; | ||
const numChannels = 1; | ||
const freq = 441; | ||
|
||
const offlineContext = new OfflineAudioContext(numChannels, length * sampleRate, sampleRate); | ||
const osc = offlineContext.createOscillator(); | ||
osc.type = 'sine'; | ||
osc.frequency.value = freq; | ||
osc.connect(offlineContext.destination); | ||
|
||
const bufferData = new Promise((resolve, reject) => { | ||
osc.start(); | ||
offlineContext.startRendering().then((buffer) => { | ||
resolve(buffer.getChannelData(0)); | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* @class DummyProcessor | ||
* @extends AudioWorkletProcessor | ||
* | ||
* This processor class demonstrates the bare-bone structure of the processor. | ||
*/ | ||
class DummyProcessor extends AudioWorkletProcessor { | ||
constructor() { | ||
super(); | ||
} | ||
|
||
process(inputs, outputs, parameters) { | ||
// Doesn't do anything here. | ||
return true; | ||
} | ||
} | ||
|
||
registerProcessor('dummy', DummyProcessor); |
Oops, something went wrong.