Skip to content

Commit 867f11c

Browse files
committed
Improved documentation
1 parent 3b2036b commit 867f11c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

docs.html

+11-3
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,18 @@ <h3>Linear Memory</h3>
8888

8989
<pre><code class="language-js">
9090
// Total memory consumption in this example: 256 * 4 = 1024 bytes.
91-
let someBuffer = Superpowered.createFloatArray(256);
91+
let someBuffer = new Superpowered.Float32Buffer(256);
9292

9393
someBuffer.pointer; // Getting the linear memory index (pointer).
9494
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).
9696

9797
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+
...
98103
</code></pre>
99104

100105
<h3>Web Audio</h3>
@@ -1514,6 +1519,9 @@ <h3>TimeStretching</h3>
15141519
// 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.
15151520
ts.pitchShiftCents = 100;
15161521

1522+
// Amount of formant correction, between 0 (none) and 1 (full). Default: 0.
1523+
ts.formantCorrection = 0.5;
1524+
15171525
// Returns with how many frames of input should be provided to the time stretcher to produce some output.
15181526
// It's never blocking for real-time usage. Use it in the same thread with the other real-time methods of this class.
15191527
// 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>
15481556

15491557
<h2>Loading Audio</h2>
15501558

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>
15521560
<p>You can either use the SuperpoweredTrackLoader.downloadAndDecode API for ease of use, or the Superpowered Decoder for advanced features.</p>
15531561

15541562
<h3>SuperpoweredTrackLoader</h3>

0 commit comments

Comments
 (0)