/
ScriptProcessorNode.cljs
73 lines (60 loc) · 3.1 KB
/
ScriptProcessorNode.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
(ns web.deprecated.ScriptProcessorNode
"The ScriptProcessorNode interface allows the generation, processing,
analyzing of audio using JavaScript."
(:refer-clojure :exclude []))
(defn buffer-size
"Property.
The following example shows basic usage of a ScriptProcessorNode
take a track loaded via `AudioContext.decodeAudioData()`, process
adding a bit of white noise to each audio sample of the input
(buffer) and play it through the `web.audio.AudioDestinationNode`.
each channel and each sample frame, the scriptNode.onaudioprocess
takes the associated audioProcessingEvent and uses it to loop
each channel of the input buffer, and each sample in each channel,
add a small amount of white noise, before setting that result
be the output sample in each case.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode/bufferSize`"
[this]
(-> this (.bufferSize)))
(defn set-buffer-size!
"Property.
The following example shows basic usage of a ScriptProcessorNode
take a track loaded via `AudioContext.decodeAudioData()`, process
adding a bit of white noise to each audio sample of the input
(buffer) and play it through the `web.audio.AudioDestinationNode`.
each channel and each sample frame, the scriptNode.onaudioprocess
takes the associated audioProcessingEvent and uses it to loop
each channel of the input buffer, and each sample in each channel,
add a small amount of white noise, before setting that result
be the output sample in each case.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode/bufferSize`"
[this val]
(aset this "bufferSize" val))
(defn onaudioprocess
"Property.
The following example shows basic usage of a ScriptProcessorNode
take a track loaded via `AudioContext.decodeAudioData()`, process
adding a bit of white noise to each audio sample of the input
(buffer) and play it through the `web.audio.AudioDestinationNode`.
each channel and each sample frame, the scriptNode.onaudioprocess
takes the associated audioProcessingEvent and uses it to loop
each channel of the input buffer, and each sample in each channel,
add a small amount of white noise, before setting that result
be the output sample in each case.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode/onaudioprocess`"
[this]
(-> this (.onaudioprocess)))
(defn set-onaudioprocess!
"Property.
The following example shows basic usage of a ScriptProcessorNode
take a track loaded via `AudioContext.decodeAudioData()`, process
adding a bit of white noise to each audio sample of the input
(buffer) and play it through the `web.audio.AudioDestinationNode`.
each channel and each sample frame, the scriptNode.onaudioprocess
takes the associated audioProcessingEvent and uses it to loop
each channel of the input buffer, and each sample in each channel,
add a small amount of white noise, before setting that result
be the output sample in each case.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode/onaudioprocess`"
[this val]
(aset this "onaudioprocess" val))