A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bbc/r-audio/wiki/API-Reference below:

API Reference · bbc/r-audio Wiki · GitHub

r-audio exports a number of React Components falling into the following categories:

Component classes listed as (private) are not exported, but may be adding props to the descendant classes which are useful to document.

Initialises an AudioContext and encapsulates one audio graph.

Base class for all components requiring an AudioContext. If a RComponent is placed outside an RAudioContext, a ReferenceError is thrown.

Inherits from RComponent and manages the lifecycle, connections and updates to an audio node.

<RBiquadFilter frequency={220} gain={1.1} transitionTime={ { frequency: 0.5, gain: 0.3 } } />
RConnectableNode (private)

Inherits from RAudioNode. Represents any RAudioNode that can be connected to. Handles disconnection from parent nodes in a pipeline.

RScheduledSource (private)

Inherits from RAudioNode. Components which wrap nodes inheriting from the AudioScheduledSourceNode class in Web Audio inherit from RScheduledSource.

Connects its children in a series, i.e. for a list of children [A,B,C] the connections will be A -> B -> C.

In a RPipeline, if a non-connectable node appears between two other nodes, an inbound branch must be created. Consider the following graph configuration:

<RPipeline>
    <ROscillator start={0} frequency={440} />
    <RBiquadFilter frequency={5000} />
    <ROscillator
        start={0}
        frequency={2}
        connectToParam="gain" />
    <RGain gain={0.5} />
</RPipeline>

The pipeline is resolved from the end, so RGain will be connected to the nearest preceding connectable node – RBiquadFilter. The second oscillator will constitute an in- bound branch and connect to the gain parameter of RGain. The resulting graph is depicted below:

Connects its children in parallel, i.e. the input will be connected to each child, and each child will be connected to the destination.

Connects every child to the child itself, as well as the destination.

A composite component which connects children in parallel (like RSplit), and distributes the input signal channels to individual children.

Composition of RSplitChannels

An "abstract" component which can be subclassed to create custom reusable r-audio components (subgraphs). The reason for its existence is the fact that r-audio can only work with components which are subclassing RComponent.

The subgraph is declared by overriding the renderGraph method. Under the hood, it's essentially just a pipeline which renders custom content instead of its children.

The props can be set arbitrarily and mapped onto various props within the subgraph.

First, you need to create a subclass of RExtensible and override the renderGraph method, returning your subgraph.

class DelayLine extends RExtensible {
  renderGraph() {
    return (
      <RCycle>
        <RPipeline>
          <RGain gain={this.props.gain}/>
          <RDelay delayTime={this.props.delayTime}/>
        </RPipeline>
      </RCycle>
    );
  }
}

You can then use the custom component in a r-audio graph, passing custom props as desired:

render() {
  return (
    <RAudioContext>
      <RPipeline>
        <DelayLine gain={0.7} delayTime={0.3} />
      </RPipeline>
    </RAudioContext>
  );
}

These components correspond to non-deprecated AudioNodes in Web Audio. Unless specified otherwise, their props are inherited from ancestor classes + identical to properties of the Web Audio objects.

extends RConnectableNode

Corresponds to Web Audio AnalyserNode.

If the child is a function, it will be called every time the component is rendered. The first argument will be a proxy object with the following methods:

extends RConnectableNode

Corresponds to Web Audio AudioWorkletNode.

extends RConnectableNode

Corresponds to Web Audio AnalyserNode.

If the child is a function, it will be called every time the component is rendered. The first argument will be a proxy object with the following methods:

extends RScheduledSource

Corresponds to Web Audio BufferSourceNode.

extends RConnectableNode

Corresponds to Web Audio ChannelMerger. Note: if multiple nodes connect to RChannelMerger, each incoming connection is connected to a different channel

extends RConnectableNode

Corresponds to Web Audio ChannelSplitter. Note: if RChannelSplitter connects to multiple nodes, each outgoing connection is connected from a different channel

extends RScheduledSource

Corresponds to Web Audio ConstantSourceNode.

extends RConnectableNode

Corresponds to Web Audio ConvolverNode.

extends RConnectableNode

Corresponds to Web Audio DelayNode.

extends RConnectableNode

Corresponds to Web Audio DynamicsCompressorNode.

extends RConnectableNode

Corresponds to Web Audio GainNode.

extends RConnectableNode

Corresponds to Web Audio IIRFilterNode.

If the child is a function, it will be called every time the component is rendered. The first argument will be a proxy object with the following methods:

extends RAudioNode

Corresponds to Web Audio MediaElementSourceNode.

extends RAudioNode

Corresponds to Web Audio MediaStreamSourceNode.

extends RScheduledSource

Corresponds to Web Audio OscillatorNode.

extends RConnectableNode

Corresponds to Web Audio StereoPannerNode.

extends RConnectableNode

Corresponds to Web Audio PannerNode.

extends RConnectableNode

Corresponds to Web Audio WaveShaperNode.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4