You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs.html
+11-3
Original file line number
Diff line number
Diff line change
@@ -88,13 +88,18 @@ <h3>Linear Memory</h3>
88
88
89
89
<pre><codeclass="language-js">
90
90
// Total memory consumption in this example: 256 * 4 = 1024 bytes.
91
-
let someBuffer = Superpowered.createFloatArray(256);
91
+
let someBuffer = new Superpowered.Float32Buffer(256);
92
92
93
93
someBuffer.pointer; // Getting the linear memory index (pointer).
94
94
someBuffer.length; // Getting the length of the buffer.
95
-
someBuffer.array[0] = 0.5; // Accessing the buffer as a Float32Array.
95
+
someBuffer.array[0] = 0.5; // Accessing the buffer as a Float32Array (standard web TypedArray).
96
96
97
97
someBuffer.free(); // Deallocate everything.
98
+
99
+
// Other types are also available, because every web standard TypedArray specialization is supported:
100
+
new Superpowered.Uint8Buffer(...)
101
+
new Superpowered.Int32Buffer(...)
102
+
...
98
103
</code></pre>
99
104
100
105
<h3>Web Audio</h3>
@@ -1514,6 +1519,9 @@ <h3>TimeStretching</h3>
1514
1519
// When the value if a multiply of 100 and is >= -1200 and <= 1200, changing the pitch shift needs only a few CPU clock cycles. Any change in pitchShiftCents involves significant momentary CPU load otherwise.
1515
1520
ts.pitchShiftCents = 100;
1516
1521
1522
+
// Amount of formant correction, between 0 (none) and 1 (full). Default: 0.
1523
+
ts.formantCorrection = 0.5;
1524
+
1517
1525
// Returns with how many frames of input should be provided to the time stretcher to produce some output.
1518
1526
// It's never blocking for real-time usage. Use it in the same thread with the other real-time methods of this class.
1519
1527
// The result can be 0 if rate is 1 and pitch shift is 0, because in that case the time stretcher is fully "transparent" and any number of input frames will produce some output.
@@ -1548,7 +1556,7 @@ <h3>TimeStretching</h3>
1548
1556
1549
1557
<h2>Loading Audio</h2>
1550
1558
1551
-
<p>Due to nature of most JavaScript runtimes (such as no control over thread scheduling or no direct disk access), loading audio with Superpowered is a little bit different vs. native. <em>The entire audio file must be loaded into the WebAssembly Linear Memory memory</em> first, then the Superpowered Decoder can read and decode it.</p>
1559
+
<p>Due to the nature of most JavaScript runtimes (such as no control over thread scheduling or no direct disk access), loading audio with Superpowered is a little bit different vs. native. <em>The entire audio file must be loaded into the WebAssembly Linear Memory memory</em> first, then the Superpowered Decoder can read and decode it.</p>
1552
1560
<p>You can either use the SuperpoweredTrackLoader.downloadAndDecode API for ease of use, or the Superpowered Decoder for advanced features.</p>
0 commit comments