Add a "narrow" railroad diagram to the audio scope post; add line numbers to the samples
listing
This commit is contained in:
parent
fc2bbb2126
commit
3b74c3a256
1 changed files with 9 additions and 1 deletions
|
@ -91,6 +91,14 @@ Our audio processing graph looks like this:
|
|||
rr.Terminal("destination")));
|
||||
{{< /figures/railroad >}}
|
||||
|
||||
{{< figures/railroad id="audioContextDiagram" class="narrow-only" >}}
|
||||
return rr.Diagram(
|
||||
rr.Stack(
|
||||
rr.Terminal("<audio>"),
|
||||
rr.Terminal("Analyzer"),
|
||||
rr.Terminal("destination")));
|
||||
{{< /figures/railroad >}}
|
||||
|
||||
By itself the AudioContext doesn't actually play any audio. I'll tackle that
|
||||
next.
|
||||
|
||||
|
@ -178,7 +186,7 @@ for (let i = 0; i < samples.length; i++) {
|
|||
|
||||
The most interesting part of this function starts at line 66 where we get an array of samples from the analyzer node. The `samples` variable is a JavaScript `Float32Array`, with one element for each pixel of width.
|
||||
|
||||
```js {linenos=false}
|
||||
```js {linenostart=30}
|
||||
samples = new Float32Array(p.width);
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue