An experimental, JSX-compatible renderer for the Web Audio API
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
example
src
.babelrc
.editorconfig
.eslintrc.js
.gitignore
.npmignore
.nvmrc
.travis.yml
README.md
jest.config.js
package-lock.json Adds Travis CI config and CI test script to report coverage to coveralls Sep 26, 2018
package.json
rollup.config.js

README.md

Wax

Travis CI status Code coverage status npm version

An experimental, JSX-compatible renderer for the Web Audio API. I wrote Wax for my Manchester Web Meetup talk, Manipulating the Web Audio API with JSX and custom renderers (video coming soon).

While it has decent test coverage and is stable, I still deem this to be a work-in-progress. Use in production at your own risk!

/** @jsx createAudioElement */

import {
    createAudioElement,
    renderAudioGraph,
    AudioGraph,
    Oscillator,
    Gain,
    StereoPanner,
    Destination,
    setValueAtTime,
    exponentialRampToValueAtTime,
} from 'wax-core';

renderAudioGraph(
    <AudioGraph>
        <Oscillator
            frequency={[
                setValueAtTime(200, 0),
                exponentialRampToValueAtTime(800, 3),
            ]}
            type="square"
            endTime={3}
        />
        <Gain gain={0.2} />
        <StereoPanner pan={-1} />
        <Destination />
    </AudioGraph>
);

Example Apps

Consult the example directory for a few small example apps that use Wax. The included README summarises them and details how they can be built and ran.

Documentation