audio-buffer-list
Advanced tools
Comparing version 3.1.0 to 3.2.0
37
index.js
@@ -23,2 +23,6 @@ /** | ||
if (isPlainObj(arg)) { | ||
options = arg | ||
arg = null | ||
} | ||
if (typeof options === 'number') { | ||
@@ -43,2 +47,7 @@ options = {channels: options} | ||
//test instance | ||
AudioBufferList.isInstance = function (a) { | ||
return a instanceof AudioBufferList | ||
} | ||
//copy from channel into destination array | ||
@@ -94,4 +103,4 @@ AudioBufferList.prototype.copyFromChannel = function (destination, channel, from, to) { | ||
AudioBufferList.prototype.append = function (buf) { | ||
//FIXME: we may want to do resampling/channel mapping here or something | ||
var i = 0 | ||
//FIXME: we may want to do resampling/channel mapping here or something | ||
var i = 0 | ||
@@ -112,7 +121,7 @@ // unwrap argument into individual BufferLists | ||
else if (buf) { | ||
buf = util.create(buf, this.numberOfChannels) | ||
this._appendBuffer(buf) | ||
} | ||
buf = util.create(buf, this.numberOfChannels) | ||
this._appendBuffer(buf) | ||
} | ||
return this | ||
return this | ||
} | ||
@@ -169,10 +178,10 @@ | ||
if (typeof srcStart != 'number' || srcStart < 0) | ||
srcStart = 0 | ||
if (typeof srcEnd != 'number' || srcEnd > this.length) | ||
srcEnd = this.length | ||
if (srcStart >= this.length) | ||
return dst || new AudioBuffer(null, {length: 0}) | ||
if (srcEnd <= 0) | ||
return dst || new AudioBuffer(null, {length: 0}) | ||
if (typeof srcStart != 'number' || srcStart < 0) | ||
srcStart = 0 | ||
if (typeof srcEnd != 'number' || srcEnd > this.length) | ||
srcEnd = this.length | ||
if (srcStart >= this.length) | ||
return dst || new AudioBuffer(null, {length: 0}) | ||
if (srcEnd <= 0) | ||
return dst || new AudioBuffer(null, {length: 0}) | ||
@@ -179,0 +188,0 @@ var copy = !!dst |
{ | ||
"name": "audio-buffer-list", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "Data structure for sequence of AudioBuffers", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -26,3 +26,3 @@ # audio-buffer-list [![Build Status](https://travis-ci.org/audiojs/audio-buffer-list.svg?branch=master)](https://travis-ci.org/audiojs/audio-buffer-list) [![unstable](https://img.shields.io/badge/stability-unstable-green.svg)](http://github.com/badges/stability-badges) [![Greenkeeper badge](https://badges.greenkeeper.io/audiojs/audio-buffer-list.svg)](https://greenkeeper.io/) | ||
* [new AudioBufferList(src, opts?)](#new-audiobufferlistsource-options) | ||
* [new AudioBufferList(src?, opts?)](#new-audiobufferlistsource-options) | ||
* [list.append(buf)](#listappendbuffer) | ||
@@ -46,2 +46,3 @@ * [list.insert(idx?, buf)](#listinsertoffset0-buffer) | ||
* [list.destroy()](#listdestroy) | ||
* [AudioBufferList.isInatance(arg)](#audiobufferlistisinstancearg) | ||
@@ -151,2 +152,6 @@ ### `new AudioBufferList(source, options?)` | ||
### `AudioBufferList.isInstance(arg)` | ||
Check if passed argument is instance of _AudioBufferList_. | ||
## See also | ||
@@ -153,0 +158,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23401
460
160