elastica

timestretch audio in the browser

It bridges the web audio api (audio buffers, audio workers) with the timestretch functions of dsp-kit

Will be published as an independent module

Source:

Methods

(inner) stretch(factor, buffer, optionsopt) → {AudioBuffer}

Perform time-stretch to an audio buffer

Parameters:
Name Type Attributes Description
factor Number

the stretch factor (< 1 reduce duration, > 1 expand duration)

buffer AudioBuffer

a WebAudio's AudioBuffer

options Object <optional>

An optional object with configuration:

  • {String} algorithm = 'phase-vocoder': the algorithm to be use. Valid values are: 'phase-vocoder', 'ola', 'paul-stretch'. Default: 'phase-vocoder'
  • {Integer} size = 4096: the frame size
  • {Integer} hop = 1024: the hop size
  • {AudioContext} context: the audio context to use (or use 'audio-context' npm package)
Source:
Returns:

a new audio buffer

Type
AudioBuffer