Socket
Socket
Sign inDemoInstall

audio-buffer-list

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

audio-buffer-list

Data structure for sequence of AudioBuffers


Version published
Weekly downloads
296
decreased by-32.42%
Maintainers
1
Weekly downloads
 
Created
Source

audio-buffer-list Build Status experimental

Extension of BufferList for AudioBuffers. Handy and performant to deal with sequence of audio buffers − accumulate, read, stream, modify, delete etc. It provides interfaces both of AudioBuffer and BufferList, as well as bunch of other useful methods.

Usage

npm install audio-buffer-list

const AudioBufferList = require('audio-buffer-list')
const AudioBuffer = require('audio-buffer')

let abl = new AudioBufferList(new AudioBuffer(1, [0, .1, .2, .3]), new AudioBuffer(1, 100))

abl.append(new AudioBuffer(1, 100))

abl.length // 204
abl.slice() // <AudioBuffer 0, .1, .2, .3, 0...>

API

new AudioBufferList(source, options?)

source can be AudioBuffer, AudioBuffer array, AudioBufferList, AudioBufferList array or callback.

options may provide numberOfChannels, context for web audio API context and sampleRate.

new is not strictly required.

list.getChannelData(channel)

Return FloatArray with merged data for the channel.

list.copyFromChannel(destination, channel, startInChannel=0)

Put data from the channel to destination FloatArray. Optional startInChannel defines offset in the channel to start from.

list.copyToChannel(source, channel, startInChannel=0)

Put data from the source FloatArray into channel, optionally starting at startInChannel offset.

list.repeat(count)

Repeats contents of the list specified number of times. Modifies list in-place.

See also

  • audio — high-level class for audio
  • audio-buffer — audio buffer class for nodejs and browser
  • audio-buffer-utils — toolset for audio buffers
  • buffer-list — canonical BufferList implementation

Keywords

FAQs

Package last updated on 14 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