probe-web / @probe-web/ui / SampleDecoder
Class: SampleDecoder
Defined in: packages/ui/src/samples.ts:38
Decodes a stream of samples, carrying an incomplete tail between calls.
One decoder per channel: they each have their own leftover bytes.
Constructors
Constructor
new SampleDecoder(format?): SampleDecoder;Defined in: packages/ui/src/samples.ts:43
Start a decoder for format samples with no leftover bytes.
Parameters
| Parameter | Type | Default value |
|---|---|---|
format | SampleFormat | 'u32' |
Returns
SampleDecoder
Accessors
format
Get Signature
get format(): SampleFormat;Defined in: packages/ui/src/samples.ts:51
The sample format being decoded. Changing the format drops any partial sample, which belonged to the old one.
Returns
Set Signature
set format(format): void;Defined in: packages/ui/src/samples.ts:55
Parameters
| Parameter | Type |
|---|---|
format | SampleFormat |
Returns
void
Methods
reset()
reset(): void;Defined in: packages/ui/src/samples.ts:62
Forget any partial sample, e.g. after a reset.
Returns
void
push()
push(bytes): number[];Defined in: packages/ui/src/samples.ts:70
Decode whatever whole samples these bytes complete, together with any leftover from the previous call. A trailing partial sample is kept for the next call.
Parameters
| Parameter | Type |
|---|---|
bytes | Uint8Array<ArrayBufferLike> | number[] |
Returns
number[]