{"_id":"audio-context","_rev":"4204343","name":"audio-context","description":"A WebAudio Context singleton","dist-tags":{"latest":"1.0.3"},"maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"155263213@qq.com"},{"name":"jamen","email":""},{"name":"juliangruber","email":"julian@juliangruber.com"}],"time":{"modified":"2026-03-04T17:02:58.000Z","created":"2013-12-14T03:37:36.426Z","1.0.3":"2018-01-11T15:34:56.516Z","1.0.2":"2018-01-11T15:07:31.676Z","1.0.1":"2017-05-23T15:10:31.909Z","1.0.0":"2017-04-30T00:42:12.365Z","0.1.0":"2014-07-29T09:08:07.104Z","0.0.0":"2013-12-14T03:37:36.426Z"},"users":{},"author":{"name":"Julian Gruber","email":"mail@juliangruber.com","url":"http://juliangruber.com"},"repository":{"type":"git","url":"git://github.com/audiojs/audio-context.git"},"versions":{"1.0.3":{"name":"audio-context","description":"A WebAudio Context singleton","version":"1.0.3","scripts":{"test":"browserify test.js | tape-run && node test"},"repository":{"type":"git","url":"git://github.com/audiojs/audio-context.git"},"homepage":"https://github.com/audiojs/audio-context","devDependencies":{"browserify":"^15.1.0","is-browser":"^2.0.1","tape":"*","tape-run":"^3.0.0"},"keywords":["webaudio","audio","audiojs","context","singleton"],"author":{"name":"Julian Gruber","email":"mail@juliangruber.com","url":"http://juliangruber.com"},"license":"MIT","testling":{"files":"test.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"gitHead":"09b83d885433b6b2a6c4defdc2aabc7ab380c188","bugs":{"url":"https://github.com/audiojs/audio-context/issues"},"_id":"audio-context@1.0.3","_npmVersion":"5.6.0","_nodeVersion":"8.1.2","_npmUser":{"name":"dfcreative","email":"df.creative@gmail.com"},"dist":{"shasum":"aae5636691a8cdc15fc91059704cbc7c2fb7abf9","size":3101,"noattachment":false,"key":"/audio-context/-/audio-context-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/audio-context/download/audio-context-1.0.3.tgz"},"maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"155263213@qq.com"},{"name":"jamen","email":""},{"name":"juliangruber","email":"julian@juliangruber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/audio-context-1.0.3.tgz_1515684895616_0.21141836768947542"},"directories":{},"publish_time":1515684896516,"_hasShrinkwrap":false,"_cnpm_publish_time":1515684896516,"_cnpmcore_publish_time":"2021-12-17T02:18:28.795Z","deprecated":"Depends on Web-Audio-API implementation. Use either web-audio-api, web-audio-js or web-audio-engine package."},"1.0.2":{"name":"audio-context","description":"A WebAudio Context singleton","version":"1.0.2","scripts":{"test":"browserify test.js | tape-run && node test"},"repository":{"type":"git","url":"git://github.com/audiojs/audio-context.git"},"homepage":"https://github.com/audiojs/audio-context","devDependencies":{"is-browser":"^2.0.1","tape":"*","tape-run":"^3.0.0"},"keywords":["webaudio","audio","audiojs","context","singleton"],"author":{"name":"Julian Gruber","email":"mail@juliangruber.com","url":"http://juliangruber.com"},"license":"MIT","testling":{"files":"test.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"gitHead":"5cce34a20acec2f8eb8eef7ffdee675f8915ce6d","bugs":{"url":"https://github.com/audiojs/audio-context/issues"},"_id":"audio-context@1.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.1.2","_npmUser":{"name":"dfcreative","email":"df.creative@gmail.com"},"dist":{"shasum":"2d2266583ac78d524c8fb14af82eb360b132d298","size":3092,"noattachment":false,"key":"/audio-context/-/audio-context-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/audio-context/download/audio-context-1.0.2.tgz"},"maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"155263213@qq.com"},{"name":"jamen","email":""},{"name":"juliangruber","email":"julian@juliangruber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/audio-context-1.0.2.tgz_1515683251567_0.31027306197211146"},"directories":{},"publish_time":1515683251676,"_hasShrinkwrap":false,"_cnpm_publish_time":1515683251676,"_cnpmcore_publish_time":"2021-12-17T02:18:29.153Z","deprecated":"Depends on Web-Audio-API implementation. Use either web-audio-api, web-audio-js or web-audio-engine package."},"1.0.1":{"name":"audio-context","description":"A WebAudio Context singleton","version":"1.0.1","scripts":{"test":"browserify test.js | tape-run"},"repository":{"type":"git","url":"git://github.com/audiojs/audio-context.git"},"homepage":"https://github.com/audiojs/audio-context","dependencies":{"global":"^4.3.1"},"devDependencies":{"browserify":"^14.3.0","is-browser":"^2.0.1","tape":"*","tape-run":"^3.0.0"},"keywords":["webaudio","audio","context","singleton"],"author":{"name":"Julian Gruber","email":"mail@juliangruber.com","url":"http://juliangruber.com"},"license":"MIT","testling":{"files":"test.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"gitHead":"c0b5cd24a5d2e9ff6a54b0087690867e2c184601","bugs":{"url":"https://github.com/audiojs/audio-context/issues"},"_id":"audio-context@1.0.1","_shasum":"cec4db8ace6ef4aacbf10eef0977a4571468d4ab","_from":".","_npmVersion":"3.7.2","_nodeVersion":"6.2.0","_npmUser":{"name":"dfcreative","email":"df.creative@gmail.com"},"maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"155263213@qq.com"},{"name":"jamen","email":""},{"name":"juliangruber","email":"julian@juliangruber.com"}],"dist":{"shasum":"cec4db8ace6ef4aacbf10eef0977a4571468d4ab","size":3082,"noattachment":false,"key":"/audio-context/-/audio-context-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/audio-context/download/audio-context-1.0.1.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/audio-context-1.0.1.tgz_1495552230998_0.8072761849034578"},"directories":{},"publish_time":1495552231909,"_hasShrinkwrap":false,"_cnpm_publish_time":1495552231909,"_cnpmcore_publish_time":"2021-12-17T02:18:29.385Z","deprecated":"Depends on Web-Audio-API implementation. Use either web-audio-api, web-audio-js or web-audio-engine package."},"1.0.0":{"name":"audio-context","description":"A WebAudio Context singleton","version":"1.0.0","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/audiojs/audio-context.git"},"homepage":"https://github.com/audiojs/audio-context","dependencies":{"global":"^4.3.1"},"devDependencies":{"is-browser":"^2.0.1","tape":"*"},"keywords":["webaudio","audio","context","singleton"],"author":{"name":"Julian Gruber","email":"mail@juliangruber.com","url":"http://juliangruber.com"},"license":"MIT","testling":{"files":"test.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"gitHead":"c65c9bc57bcd766ba7228762cff70ee0806b6e96","bugs":{"url":"https://github.com/audiojs/audio-context/issues"},"_id":"audio-context@1.0.0","_shasum":"4b665d27963c3675c29ddc9436946ad0dca48609","_from":".","_npmVersion":"3.7.2","_nodeVersion":"6.2.0","_npmUser":{"name":"dfcreative","email":"df.creative@gmail.com"},"maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"155263213@qq.com"},{"name":"jamen","email":""},{"name":"juliangruber","email":"julian@juliangruber.com"}],"dist":{"shasum":"4b665d27963c3675c29ddc9436946ad0dca48609","size":2782,"noattachment":false,"key":"/audio-context/-/audio-context-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/audio-context/download/audio-context-1.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/audio-context-1.0.0.tgz_1493512931748_0.49239392275922"},"directories":{},"publish_time":1493512932365,"_hasShrinkwrap":false,"_cnpm_publish_time":1493512932365,"_cnpmcore_publish_time":"2021-12-17T02:18:29.659Z","deprecated":"Depends on Web-Audio-API implementation. Use either web-audio-api, web-audio-js or web-audio-engine package."},"0.1.0":{"name":"audio-context","description":"A WebAudio Context singleton","version":"0.1.0","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/juliangruber/audio-context.git"},"homepage":"https://github.com/juliangruber/audio-context","dependencies":{"global":"~4.2.1"},"devDependencies":{"tape":"*"},"keywords":["webaudio","audio","context","singleton"],"author":{"name":"Julian Gruber","email":"mail@juliangruber.com","url":"http://juliangruber.com"},"license":"MIT","testling":{"files":"test.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"bugs":{"url":"https://github.com/juliangruber/audio-context/issues"},"_id":"audio-context@0.1.0","dist":{"shasum":"116ee83d566e10e7e845f29d9b1e1bc2ea3520d2","size":1647,"noattachment":false,"key":"/audio-context/-/audio-context-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/audio-context/download/audio-context-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.22","_npmUser":{"name":"juliangruber","email":"julian@juliangruber.com"},"maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"155263213@qq.com"},{"name":"jamen","email":""},{"name":"juliangruber","email":"julian@juliangruber.com"}],"directories":{},"publish_time":1406624887104,"_hasShrinkwrap":false,"_cnpm_publish_time":1406624887104,"_cnpmcore_publish_time":"2021-12-17T02:18:29.847Z","deprecated":"Depends on Web-Audio-API implementation. Use either web-audio-api, web-audio-js or web-audio-engine package."},"0.0.0":{"name":"audio-context","description":"A WebAudio Context singleton","version":"0.0.0","repository":{"type":"git","url":"git://github.com/juliangruber/audio-context.git"},"homepage":"https://github.com/juliangruber/audio-context","dependencies":{},"devDependencies":{"tape":"*"},"keywords":["webaudio","audio","context","singleton"],"author":{"name":"Julian Gruber","email":"mail@juliangruber.com","url":"http://juliangruber.com"},"license":"MIT","readmeFilename":"Readme.md","bugs":{"url":"https://github.com/juliangruber/audio-context/issues"},"_id":"audio-context@0.0.0","dist":{"shasum":"f1f35e06b03df748fb1feed09b744137e81370e6","size":1019,"noattachment":false,"key":"/audio-context/-/audio-context-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/audio-context/download/audio-context-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"juliangruber","email":"julian@juliangruber.com"},"maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"155263213@qq.com"},{"name":"jamen","email":""},{"name":"juliangruber","email":"julian@juliangruber.com"}],"directories":{},"publish_time":1386992256426,"_hasShrinkwrap":false,"_cnpm_publish_time":1386992256426,"_cnpmcore_publish_time":"2021-12-17T02:18:30.090Z","deprecated":"Depends on Web-Audio-API implementation. Use either web-audio-api, web-audio-js or web-audio-engine package."}},"readme":"# audio-context [![Build Status](https://travis-ci.org/audiojs/audio-context.svg?branch=master)](https://travis-ci.org/audiojs/audio-context) [![unstable](https://img.shields.io/badge/stability-unstable-green.svg)](http://github.com/badges/stability-badges) [![Greenkeeper badge](https://badges.greenkeeper.io/audiojs/audio-context.svg)](https://greenkeeper.io/) [![npm](https://img.shields.io/npm/v/audio-context.svg)](https://www.npmjs.com/package/audio-context) [![license](https://img.shields.io/npm/l/audio-context.svg)](https://www.npmjs.com/package/audio-context)\r\n\r\nCreates a WebAudio context singleton with the given options. Returns `null` if not supported.\r\n\r\n\r\n## Example\r\n\r\n```js\r\nvar audioCtx = require('audio-context')()\r\n```\r\n\r\nYou can also create an [`OfflineAudioContext`](https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext) in case you would like to process (faster) without any rendering.\r\n\r\n\r\n```js\r\nvar offlineContext = require('audio-context')({offline: true})\r\n```\r\n\r\n\r\n## Usage\r\n\r\n[![npm install audio-context](https://nodei.co/npm/audio-context.png?mini=true)](https://npmjs.org/package/audio-context/)\r\n\r\n#### `ctx = createContext(options|sampleRate)`\r\n\r\nReturns a singleton audio context for the given `sampleRate`.\r\n\r\nThe options:\r\n\r\n- `sampleRate` - if specified, will set the context sampleRate.\r\n- `latencyHint` - if specified, will control latency. One of `'balanced'`, `'playback'`, `'interaction'` (default) or number.\r\n- `offline` - if specified, will create [OfflineAudioContext](https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext).\r\n- `length` - if specified, will set number of frames for offline context.\r\n- `channels` - if specified, will set number of channels for offline context.\r\n- `{...contextAttributes}` any other options for the context.\r\n\r\nHandles vendor prefixing for audio contexts. Returns `null` if we are not in a browser, or if the context is not available, or if there was an error creating the context.\r\n\r\n\r\n## Running tests\r\n\r\n```sh\r\n# Run tests in tape-run's default browser\r\nnpm test\r\n\r\n# Run in a specified browser.\r\n# See https://github.com/juliangruber/tape-run#runopts for options\r\nnpm test -- --browser firefox\r\n```\r\n\r\n\r\n## License\r\n\r\nMIT\r\n","_attachments":{},"homepage":"https://github.com/audiojs/audio-context","bugs":{"url":"https://github.com/audiojs/audio-context/issues"},"license":"MIT"}