Skip to content

Releases: audiojs/audio-buffer

7.3.0

23 Mar 21:14
@dy dy

Choose a tag to compare

from accepts fill value or map function as second arg, like Array.from:

from(1024, 0.5)                          // filled buffer
from(1024, (s, i) => Math.sin(i * 0.1)) // generate
from(buf, v => v * 0.5)                  // clone + transform
from(buf, 0)                             // zeroed clone (replaces like)

Removed like and resize — covered by from and slice/pad.

v7.2.0

23 Mar 19:44
@dy dy

Choose a tag to compare

  • Moved slice, concat, set, like out of AudioBuffer class into audio-buffer/util
  • AudioBuffer class now spec-only (constructor, properties, getChannelData, copyFromChannel, copyToChannel, Symbol.iterator)
  • Absorbed is-audio-buffer — available as isAudioBuffer from audio-buffer/util
  • equal renamed to isEqual
  • fromArray folded into from (eliminated double-copy)
  • filledWithVal removed — use fill(from(...), val)
  • concat now variadic — concat(a, b, c, ...)
  • from(null) throws instead of silently creating 1-sample buffer
  • mix throws RangeError on out-of-bounds offset
  • Removed noise — use fill(buf, () => Math.random() * 2 - 1)
  • Removed invert — use fill(buf, v => -v)
  • Removed options.channels alias — use numberOfChannels

Full Changelog: v7.1.0...v7.2.0

v7.1.0

23 Mar 18:48
@dy dy

Choose a tag to compare

  • Add isAudioBuffer(value) named export — duck-typed predicate, absorbs is-audio-buffer
  • Rewrite audio-buffer/play: Web Audio API in browsers, dynamic import('audio-speaker') in Node
  • Fix AudioContext leak — reuse single context across calls
  • Fix replay after stop and natural end
  • Remove audio-speaker from runtime dependencies — zero deps
  • Add files field to package.json — clean tarball
  • Fix README lead example — buf = normalize(trim(buf)) instead of discarded result

Full Changelog: v7.0.0...v7.1.0

v7.0.0

23 Mar 18:47
@dy dy

Choose a tag to compare

  • Add audio-buffer/util subpath — 15 pure sample operations: from, fill, mix, normalize, trim, reverse, equal, noise, remix, pad, invert, rotate, repeat, resize, removeDC
  • Add audio-buffer/play subpath — playback helper
  • Add subpath exports (., ./util, ./play)
  • Add slice, concat, set instance methods
  • Add fromArray, like, filledWithVal static factories
  • Absorbs audio-buffer-utils, audio-buffer-from, audio-buffer-remix, audio-play
  • Move tests to test directory

Full Changelog: v6.0.1...v7.0.0

v6.0.0

16 Mar 17:26
@dy dy

Choose a tag to compare

  • private fields, read-only properties
  • positional constructor form
  • slice, concat, set methods
  • fromArray, filledWithVal factories
  • engine-optimized copyFromChannel/copyToChannel
  • channel bounds validation on all methods
  • esm-only, zero deps

Full Changelog: v5.0.0...v6.0.0

v5.0.0

29 Jan 04:06
@dy dy

Choose a tag to compare

  • Platform-independent audio-buffer implementation
  • Converted to ESM
  • WAA-compatible API
  • Ponyfill style
  • 0 dependencies
  • Better tests
  • Updated CI