Skip to content

Commit a4cfb9a

Browse files
committed
Add AudioWorkletNode and associated options.
1 parent 4dda4bf commit a4cfb9a

File tree

4 files changed

+81
-0
lines changed

4 files changed

+81
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/** Documentation is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API and available
2+
* under the Creative Commons Attribution-ShareAlike v2.5 or later. http://creativecommons.org/licenses/by-sa/2.5/
3+
*
4+
* Everything else is under the MIT License http://opensource.org/licenses/MIT
5+
*/
6+
7+
package org.scalajs.dom
8+
9+
import scala.scalajs.js
10+
import scala.scalajs.js.annotation._
11+
12+
@JSGlobal
13+
@js.native
14+
abstract class AudioWorkletNode(context: BaseAudioContext, name: String, options: AudioWorkletNodeOptions = js.native) extends AudioNode {
15+
16+
def port: MessagePort
17+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/** Documentation is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API and available
2+
* under the Creative Commons Attribution-ShareAlike v2.5 or later. http://creativecommons.org/licenses/by-sa/2.5/
3+
*
4+
* Everything else is under the MIT License http://opensource.org/licenses/MIT
5+
*/
6+
7+
package org.scalajs.dom
8+
9+
import scala.scalajs.js
10+
11+
trait AudioWorkletNodeOptions extends js.Any {
12+
13+
/** The value to initialize the [[AudioNode#numberOfInputs]] property. Defaults to 1. */
14+
var numberOfInputs: js.UndefOr[Int] = js.undefined
15+
/** The value to initialize the [[AudioNode#numberOfOutputs]] property. Defaults to 1. */
16+
var numberOfOutputs: js.UndefOr[Int] = js.undefined
17+
var outputChannelCount: js.UndefOr[js.Array[Int]] = js.undefined
18+
var parameterData: js.UndefOr[js.Object] = js.undefined
19+
var processorOptions: js.UndefOr[js.Any] = js.undefined
20+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/** Documentation is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API and available
2+
* under the Creative Commons Attribution-ShareAlike v2.5 or later. http://creativecommons.org/licenses/by-sa/2.5/
3+
*
4+
* Everything else is under the MIT License http://opensource.org/licenses/MIT
5+
*/
6+
7+
package org.scalajs.dom
8+
9+
import scala.scalajs.js
10+
import scala.scalajs.js.annotation._
11+
12+
@js.native
13+
@JSGlobal
14+
abstract class AudioWorkletProcessor(options: AudioWorkletProcessorOptions) extends js.Object {
15+
16+
/** The [[MessagePort]] object that is connecting the [[AudioWorkletProcessor]] and the associated
17+
* [[AudioWorkletNode]].
18+
*/
19+
def port: MessagePort = js.native
20+
21+
def process(inputs: js.typedarray.Float32Array, outputs: js.typedarray.Float32Array, parameters: js.Object): Boolean
22+
23+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/** Documentation is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API and available
2+
* under the Creative Commons Attribution-ShareAlike v2.5 or later. http://creativecommons.org/licenses/by-sa/2.5/
3+
*
4+
* Everything else is under the MIT License http://opensource.org/licenses/MIT
5+
*/
6+
7+
package org.scalajs.dom
8+
9+
import scala.scalajs.js
10+
11+
trait AudioWorkletProcessorOptions extends js.Any {
12+
13+
/** The value to initialize the [[AudioNode#numberOfInputs]] property. Defaults to 1. */
14+
var numberOfInputs: Int
15+
16+
/** The value to initialize the [[AudioNode#numberOfOutputs]] property. Defaults to 1. */
17+
var numberOfOutputs: Int
18+
var outputChannelCount: js.Array[Int]
19+
var parameterData: js.UndefOr[js.Object] = js.undefined
20+
var processorOptions: js.UndefOr[js.Any] = js.undefined
21+
}

0 commit comments

Comments
 (0)