0.1.4 • Published 4 months ago
extra-audio v0.1.4
extra-audio
Install
npm install --save extra-audio
# or
yarn add extra-audio
API
getAllChannelData
function getAllChannelData(buffer: AudioBuffer): Float32Array[]
Get all channels at once,
because repeatedly executing AudioBuffer#getChannelData
is expensive.
encodeWAV
function encodeWAV(audioBuffer: AudioBuffer): ArrayBuffer
Encode AudioBuffer
to WAV with PCM 32-bit float little endian.
getFloatFrequencyData
function getFloatFrequencyData(input: Float32Array, output?: Float32Array): Float32Array
For optimization purposes, an output
array can be passed in.
This function has a requirement for the size of the output
,
which must be half the smallest power of 2 that greater than or equal to the size of input
.
timeStretch
function timeStretch(input: Float32Array, output: Float32Array): Float32Array
granularTimeStretch
function granularTimeStretch(
input: Float32Array
, output: Float32Array
, grainSize?: number
, window?: WindowFunction
, overlapRatio?: number
): Float32Array
granularPitchShift
function granularPitchShift(
input: Float32Array
, output: Float32Array
, pitchScale: number
, inputGrainSize?: number
, window?: WindowFunction
, overlapRatio?: number
): Float32Array