Skip to content
This repository was archived by the owner on Jun 9, 2019. It is now read-only.

mohayonao/web-audio-test-api-2

Repository files navigation

web-audio-test-api

Build Status License

Web Audio API for CI

Features

  • ✅ change api specification
  • ✅ type check assertion
  • ✅ basic validation
  • 👷 test audio graph
  • 👷 test internal parameters
  • 👷 provide best practice (strictly validation)

Installation

$ npm install web-audio-test-api@beta

API

  • createAPI(config: string|object): api
    • spec:string name of specification (e.g. "safari")
    • spec:object specification object
  • api.install([target: object]): api
    • target: object target object to install api - default: global
  • api.uninstall([target: object]): api
    • target: object target object to uninstall api - default: global
  • api.get(apiPath: string): any
    • apiPath: string path of api configuration (e. g. "/AudioNode/connect/selective")
  • api.set(apiPath: string, value: any): any
    • apiPath: string path of api configuration
    • value: any value to set

Quick Example

require("web-audio-test-api").createAPI("chrome:55").install();

const audioContext = new AudioContext();
const oscillator = new OscillatorNode(audioContext, { frequency: 880 });
const gain = new GainNode(audioContext, { gain: 0.5 });

oscillator.connect(gain).connect(audioContext.destination);
require("web-audio-test-api").createAPI("safari:10").install();

const audioContext = new webkitAudioContext();
const oscillator = audioContext.createOscillator();
const gain = audioContext.createGain();

oscillator.frequency.value = 880;
oscillator.connect(gain); // safari 10 returns void, so cannot chain the next.

gain.gain.value = 0.5;
gain.connect(audioContext.destination);

Support specifications

name released add remove move change
chrome:55 2016-12-01 - - - -
chrome:56 2017-01-25 3 6 0 0
firefox:50 2016-11-15 - - - -
firefox:51 2017-01-24 0 0 0 0
safari:9 2015-09-30 - - - -
safari:10 2016-09-20 1 0 3 8
edge:38 2016-08-02 - - - -
spec:201512 2015-12-08 13 3 20 10
spec:draft - 29 10 5 19

License

MIT

About

Web Audio API for CI

Resources

Stars

Watchers

Forks

Packages

No packages published