Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

audio-context

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

audio-context

A WebAudio Context singleton

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.4K
increased by1.78%
Maintainers
3
Weekly downloads
 
Created
Source

audio-context Build Status unstable Greenkeeper badge npm license

Creates a WebAudio context singleton with the given options. Returns null if not supported.

Example

var audioCtx = require('audio-context')()

You can also create an OfflineAudioContext in case you would like to process (faster) without any rendering.

var offlineContext = require('audio-context')({offline: true})

Usage

npm install audio-context

ctx = createContext(options|sampleRate)

Returns a singleton audio context for the given sampleRate.

The options:

  • sampleRate - if specified, will set the context sampleRate.
  • latencyHint - if specified, will control latency. One of 'balanced', 'playback', 'interaction' (default) or number.
  • offline - if specified, will create OfflineAudioContext.
  • length - if specified, will set number of frames for offline context.
  • channels - if specified, will set number of channels for offline context.
  • {...contextAttributes} any other options for the context.

Handles 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.

License

MIT

Keywords

FAQs

Package last updated on 30 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc