Skip to main content
Version: 0.10.x

Function: stripAudio()

stripAudio(audio, margin, steps?, threshold?): Float32Array

Defined in: extensions/speech/utils/kokoroUtils.ts:181

Strips leading and trailing silence using a sliding-window moving average.

Parameters​

audio​

Float32Array

The audio samples to strip.

margin​

number

The number of silence samples to preserve at each edge.

steps?​

number = 10

The moving average window length.

threshold?​

number = 0.005

The amplitude below which audio counts as silence.

Returns​

Float32Array

A view of audio with the silent edges removed.