Skip to content

An experimental, JSX-compatible renderer for the Web Audio API

Notifications You must be signed in to change notification settings

jamesseanwright/wax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

44f406b · Aug 23, 2021
Aug 23, 2021
Apr 26, 2019
Sep 24, 2019
Sep 19, 2018
Sep 16, 2018
Apr 26, 2019
Sep 16, 2018
Sep 26, 2018
Sep 16, 2018
Sep 26, 2018
Jan 17, 2019
Sep 21, 2018
Sep 26, 2018
Sep 29, 2018
Sep 16, 2018

Repository files navigation

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.

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