JSPM

standardized-audio-context

0.5.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 221397
  • Score
    100M100P100Q179394F
  • License MIT

A patched AudioContext which imitates the current API in current browsers.

Package Exports

  • standardized-audio-context

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (standardized-audio-context) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

standardized-audio-context

A patched AudioContext which imitates the current API in current browsers.

tests dependencies version

This is a hopelessly naive attempt to patch the current implementation of the Web Audio API's AudioContext in current browsers. The goal is to make them all behave as promised by the Specification.

There are of course some things which cannot be faked in a reasonable way. The most obvious amongst those is the AudioWorkerNode which is currently not implemented by any browser. Therefore the corresponding createAudioWorker() method is missing here, too. All implemented methods are covered by unit tests.

That said, there are a lot of other functions which are currently not implemented for no specific reason besides a lack of time: createAudioWorker(), createConvolver(), createDelay(), createDynamicsCompressor(), createMediaElementSource(), createMediaStreamDestination(), createMediaStreamSource(), createPanner(), createPeriodicWave(), createScriptProcessor(), createStereoPanner(), createWaveShaper(), resume() and suspend(). The listener property is also missing for now.

Usage

The standardized-audio-context is available on npm and can be installed as usual.

npm install standardized-audio-context

You can then import the AudioContext into your module like this:

import { AudioContext } from 'standardized-audio-context';

In addition to that the standardized-audio-context also exports a flag named isSupported to indicate support from the currently used browser.

import { isSupported } from 'standardized-audio-context';