Skip to content

the-monochord/cancelandholdattime-polyfill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cancelandholdattime-polyfill

Polyfill for AudioParam.prototype.cancelAndHoldAtTime()

Donate Build Status semantic-release Commitizen friendly JavaScript Style Guide

What is this project

AudioParam.prototype.cancelAndHoldAtTime() is an experimental function in the Web Audio API and only supported by Chrome based browsers.

Installation

Method 1 - add the built version to your code

Download and add https://github.com/the-monochord/cancelandholdattime-polyfill/blob/master/dist/cancelandholdattime-polyfill.min.js to your js files, then add it to your html page before other webaudio scripts with a script tag.

Method 2 - ES6 import in a nodejs project

Add the polyfill to your nodejs project by running npm i cancelandholdattime-polyfill.

Then import it in your main script:

import 'cancelandholdattime-polyfill'

// ... other imports

Method 3 - add it to your project in build time with webpack

Add the polyfill to your nodejs project by running npm i cancelandholdattime-polyfill.

Then add it to the webpack config before other files in the entry point:

// webpack.config.js
const config = {
  entry: {
    'youroutput': [
      'cancelandholdattime-polyfill/dist/cancelandholdattime-polyfill.min.js',
      './src/index.js'
    ]
  },
  // ...
}

Resources