Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.simular.ai/llms.txt

Use this file to discover all available pages before exploring further.

Class: SamplesBuffer

Defined in: index.d.ts:837 A buffer of samples treated as a source.

Constructors

Constructor

new SamplesBuffer(channels, sampleRate, samples): SamplesBuffer
Defined in: index.d.ts:846 Creates a new buffer from raw PCM samples. channels is the number of interleaved channels (1 = mono, 2 = stereo). sample_rate is samples per second per channel (e.g. 16000, 44100). samples is an array of f32 audio samples in [-1.0, 1.0].

Parameters

channels
number
sampleRate
number
samples
number[]

Returns

SamplesBuffer

Accessors

channels

Get Signature

get channels(): number
Defined in: index.d.ts:848 Number of interleaved channels (1 = mono, 2 = stereo).
Returns
number

durationMs

Get Signature

get durationMs(): number
Defined in: index.d.ts:852 Total duration of the buffer in milliseconds.
Returns
number

sampleRate

Get Signature

get sampleRate(): number
Defined in: index.d.ts:850 Samples per second per channel (e.g. 16000, 44100).
Returns
number

Methods

transcribe()

transcribe(model): string
Defined in: index.d.ts:859 Transcribe this audio buffer with the given speech-to-text model and return the recognized text. Equivalent to model.transcribe(buffer)

Parameters

model
SttModel

Returns

string