Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 14de404

Browse files
Version 2.0.1
Worker workarounds.
1 parent 812faf7 commit 14de404

File tree

6 files changed

+79
-5
lines changed

6 files changed

+79
-5
lines changed

‎docs.html‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ <h2>Basics</h2>
2525
<h3>Initialization</h3>
2626

2727
<pre><code class="language-js">
28+
// Import Superpowered.
29+
import SuperpoweredModule from './superpowered.js';
30+
31+
// Most major web browsers can not import modules in Worker scripts, therefore the import above may not work.
32+
// In that case, import Superpowered in a Worker script like this:
33+
importScripts('./superpowered-worker.js');
34+
35+
2836
// Initializes Superpowered. Returns with a Superpowered instance.
2937
// Always call this once in your main scope (main thread).
3038
// Worklets: if using Superpowered in a Worklet, call this in the Worklet as well.
@@ -502,7 +510,7 @@ <h3>FFT</h3>
502510
mag, // Pointer to floating point numbers. Input: split real part. Output: magnitudes.
503511
phase, // Pointer to floating point numbers. Input: split real part. Output: phases.
504512
9, // Should be 5 - 13 (FFT sizes 32 - 8192).
505-
true, // Forward (true) or inverse (false).
513+
true, // Forward (true) or inverse (false). Inverse PolarFFT will clear (zero) the DC offset.
506514
0 // Value of pi: The function can translate pi to any value (Google: the tau manifesto). Use 0 for pi.
507515
);
508516
</code></pre>

‎example_timestretching/processor.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var Superpowered = null;
44

55
class MyProcessor extends SuperpoweredModule.AudioWorkletProcessor {
66
// runs after the constructor
7-
onReady() {
7+
onReady() {
88
Superpowered = this.Superpowered;
99
this.posFrames = -1;
1010
// allocating some WASM memory for passing audio to the time stretcher
213 KB
Binary file not shown.
-206 KB
Binary file not shown.

‎superpowered-worker.js‎

Lines changed: 66 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎superpowered.js‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /