@ain1084/audio-worklet-stream 1.0.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/filler-frame-buffer-context.d.ts +30 -0
- package/dist/{frame-buffer/buffer-config.js → filler-frame-buffer-context.js} +5 -21
- package/dist/filler-frame-buffer-context.js.map +1 -0
- package/dist/{frame-buffer/buffer-filler.d.ts → frame-buffer-filler.d.ts} +2 -2
- package/dist/frame-buffer-filler.js +2 -0
- package/dist/frame-buffer-filler.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/output-stream-node.d.ts +4 -4
- package/dist/output-stream-node.js +9 -9
- package/dist/output-stream-node.js.map +1 -1
- package/dist/output-stream-processor.js +4 -4
- package/dist/output-stream-processor.js.map +1 -1
- package/dist/stream-node-factory.d.ts +4 -4
- package/dist/stream-node-factory.js +9 -8
- package/dist/stream-node-factory.js.map +1 -1
- package/dist/write-strategy/manual-strategy.d.ts +3 -4
- package/dist/write-strategy/manual-strategy.js +4 -4
- package/dist/write-strategy/manual-strategy.js.map +1 -1
- package/dist/write-strategy/timed-strategy.d.ts +4 -4
- package/dist/write-strategy/timed-strategy.js +5 -5
- package/dist/write-strategy/timed-strategy.js.map +1 -1
- package/dist/write-strategy/worker/message.d.ts +3 -3
- package/dist/write-strategy/worker/worker.d.ts +2 -2
- package/dist/write-strategy/worker/worker.js +8 -8
- package/dist/write-strategy/worker/worker.js.map +1 -1
- package/dist/write-strategy/worker-strategy.d.ts +3 -3
- package/dist/write-strategy/worker-strategy.js +6 -6
- package/dist/write-strategy/worker-strategy.js.map +1 -1
- package/package.json +11 -12
- package/src/{frame-buffer/buffer-config.ts → filler-frame-buffer-context.ts} +6 -50
- package/src/{frame-buffer/buffer-filler.ts → frame-buffer-filler.ts} +2 -2
- package/src/index.ts +2 -2
- package/src/output-stream-node.ts +10 -10
- package/src/output-stream-processor.ts +5 -6
- package/src/stream-node-factory.ts +12 -12
- package/src/write-strategy/manual-strategy.ts +4 -5
- package/src/write-strategy/timed-strategy.ts +7 -7
- package/src/write-strategy/worker/message.ts +3 -3
- package/src/write-strategy/worker/worker.ts +10 -10
- package/src/write-strategy/worker-strategy.ts +9 -9
- package/dist/frame-buffer/buffer-config.d.ts +0 -60
- package/dist/frame-buffer/buffer-config.js.map +0 -1
- package/dist/frame-buffer/buffer-factory.d.ts +0 -76
- package/dist/frame-buffer/buffer-factory.js +0 -55
- package/dist/frame-buffer/buffer-factory.js.map +0 -1
- package/dist/frame-buffer/buffer-filler.js +0 -2
- package/dist/frame-buffer/buffer-filler.js.map +0 -1
- package/dist/frame-buffer/buffer-reader.d.ts +0 -60
- package/dist/frame-buffer/buffer-reader.js +0 -77
- package/dist/frame-buffer/buffer-reader.js.map +0 -1
- package/dist/frame-buffer/buffer-utils.d.ts +0 -34
- package/dist/frame-buffer/buffer-utils.js +0 -34
- package/dist/frame-buffer/buffer-utils.js.map +0 -1
- package/dist/frame-buffer/buffer-writer.d.ts +0 -60
- package/dist/frame-buffer/buffer-writer.js +0 -77
- package/dist/frame-buffer/buffer-writer.js.map +0 -1
- package/dist/frame-buffer/buffer.d.ts +0 -51
- package/dist/frame-buffer/buffer.js +0 -75
- package/dist/frame-buffer/buffer.js.map +0 -1
- package/dist/write-strategy/manual.d.ts +0 -36
- package/dist/write-strategy/manual.js +0 -43
- package/dist/write-strategy/manual.js.map +0 -1
- package/dist/write-strategy/timed.d.ts +0 -36
- package/dist/write-strategy/timed.js +0 -92
- package/dist/write-strategy/timed.js.map +0 -1
- package/dist/write-strategy/worker/strategy.d.ts +0 -34
- package/dist/write-strategy/worker/strategy.js +0 -125
- package/dist/write-strategy/worker/strategy.js.map +0 -1
- package/dist/write-strategy/worker/worker-strategy.d.ts +0 -34
- package/dist/write-strategy/worker/worker-strategy.js +0 -125
- package/dist/write-strategy/worker/worker-strategy.js.map +0 -1
- package/src/frame-buffer/buffer-reader.ts +0 -82
- package/src/frame-buffer/buffer-writer.ts +0 -82
- package/src/frame-buffer/buffer.ts +0 -79
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type FrameBufferContext } from '@ain1084/audio-frame-buffer';
|
|
2
|
+
/**
|
|
3
|
+
* Parameters for creating a FillerFrameBuffer.
|
|
4
|
+
* @property channelCount - The number of audio channels.
|
|
5
|
+
* @property fillInterval - The interval in milliseconds for filling the buffer.
|
|
6
|
+
* @property sampleRate - The sample rate of the audio context.
|
|
7
|
+
* @property frameBufferChunks - The number of chunks in the frame buffer.
|
|
8
|
+
*/
|
|
9
|
+
export type FillerFrameBufferParams = Readonly<{
|
|
10
|
+
channelCount: number;
|
|
11
|
+
fillInterval?: number;
|
|
12
|
+
sampleRate?: number;
|
|
13
|
+
frameBufferChunks?: number;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Configuration for a FillerFrameBuffer.
|
|
17
|
+
* This configuration is returned by the createFillerFrameBufferConfig function.
|
|
18
|
+
* @property sampleRate - The sample rate of the audio context.
|
|
19
|
+
* @property fillInterval - The interval in milliseconds for filling the buffer.
|
|
20
|
+
*/
|
|
21
|
+
export type FillerFrameBufferContext = FrameBufferContext & Readonly<{
|
|
22
|
+
sampleRate: number;
|
|
23
|
+
fillInterval: number;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a FillerFrameBufferConfig instance.
|
|
27
|
+
* @param params - The parameters for the FillerFrameBuffer.
|
|
28
|
+
* @returns A new instance of FillerFrameBufferConfig.
|
|
29
|
+
*/
|
|
30
|
+
export declare const createFillerFrameBufferContext: (params: FillerFrameBufferParams) => FillerFrameBufferContext;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createFrameBufferContext } from '@ain1084/audio-frame-buffer';
|
|
2
2
|
/**
|
|
3
3
|
* The default number of chunks in the frame buffer when
|
|
4
4
|
* FillerFrameBufferParams.frameBufferChunks is not provided.
|
|
@@ -17,41 +17,25 @@ const DEFAULT_FRAME_BUFFER_CHUNKS = 5;
|
|
|
17
17
|
* Reference: https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletProcessor/process
|
|
18
18
|
*/
|
|
19
19
|
const AUDIO_WORKLET_BLOCK_SIZE = 128;
|
|
20
|
-
/**
|
|
21
|
-
* Creates a FrameBufferConfig instance.
|
|
22
|
-
* @param params - The parameters for the FrameBuffer.
|
|
23
|
-
* @returns A new instance of FrameBufferConfig.
|
|
24
|
-
*/
|
|
25
|
-
export const createFrameBufferConfig = (params) => {
|
|
26
|
-
return {
|
|
27
|
-
...createArrayBufferViews(SharedArrayBuffer, {
|
|
28
|
-
sampleBuffer: [Float32Array, params.frameBufferSize * params.channelCount],
|
|
29
|
-
usedFramesInBuffer: [Uint32Array, 1],
|
|
30
|
-
totalReadFrames: [BigUint64Array, 1],
|
|
31
|
-
totalWriteFrames: [BigUint64Array, 1],
|
|
32
|
-
}),
|
|
33
|
-
samplesPerFrame: params.channelCount,
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
20
|
/**
|
|
37
21
|
* Creates a FillerFrameBufferConfig instance.
|
|
38
22
|
* @param params - The parameters for the FillerFrameBuffer.
|
|
39
23
|
* @returns A new instance of FillerFrameBufferConfig.
|
|
40
24
|
*/
|
|
41
|
-
export const
|
|
25
|
+
export const createFillerFrameBufferContext = (params) => {
|
|
42
26
|
const sampleRate = params.sampleRate;
|
|
43
27
|
// Check if 'sampleRate' is a positive integer
|
|
44
28
|
if (sampleRate === undefined || (!Number.isInteger(sampleRate) || sampleRate <= 0)) {
|
|
45
29
|
throw new Error('Invalid sampleRate: must be a positive integer.');
|
|
46
30
|
}
|
|
47
31
|
const intervalMillisecond = params.fillInterval ?? DEFAULT_FILL_INTERVAL_MS;
|
|
48
|
-
const
|
|
32
|
+
const frameCount = Math.floor(sampleRate * intervalMillisecond / 1000 + (AUDIO_WORKLET_BLOCK_SIZE - 1)) & ~(AUDIO_WORKLET_BLOCK_SIZE - 1);
|
|
49
33
|
const frameBufferChunkCount = params.frameBufferChunks ?? DEFAULT_FRAME_BUFFER_CHUNKS;
|
|
50
|
-
const config =
|
|
34
|
+
const config = createFrameBufferContext({ frameCount: frameCount * frameBufferChunkCount, channelCount: params.channelCount });
|
|
51
35
|
return {
|
|
52
36
|
...config,
|
|
53
37
|
sampleRate,
|
|
54
38
|
fillInterval: intervalMillisecond,
|
|
55
39
|
};
|
|
56
40
|
};
|
|
57
|
-
//# sourceMappingURL=buffer-
|
|
41
|
+
//# sourceMappingURL=filler-frame-buffer-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filler-frame-buffer-context.js","sourceRoot":"","sources":["../src/filler-frame-buffer-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAE/F;;;;GAIG;AACH,MAAM,wBAAwB,GAAG,EAAE,CAAA;AAEnC;;;;GAIG;AACH,MAAM,2BAA2B,GAAG,CAAC,CAAA;AAErC;;;;GAIG;AACH,MAAM,wBAAwB,GAAG,GAAG,CAAA;AA2BpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,MAA+B,EAA4B,EAAE;IAC1G,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAA;IACpC,8CAA8C;IAC9C,IAAI,UAAU,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,CAAC,CAAC,EAAE,CAAC;QACnF,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAA;IACpE,CAAC;IACD,MAAM,mBAAmB,GAAG,MAAM,CAAC,YAAY,IAAI,wBAAwB,CAAA;IAC3E,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAC3B,UAAU,GAAG,mBAAmB,GAAG,IAAI,GAAG,CAAC,wBAAwB,GAAG,CAAC,CAAC,CACzE,GAAG,CAAC,CAAC,wBAAwB,GAAG,CAAC,CAAC,CAAA;IACnC,MAAM,qBAAqB,GAAG,MAAM,CAAC,iBAAiB,IAAI,2BAA2B,CAAA;IACrF,MAAM,MAAM,GAAG,wBAAwB,CACrC,EAAE,UAAU,EAAE,UAAU,GAAG,qBAAqB,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAA;IACxF,OAAO;QACL,GAAG,MAAM;QACT,UAAU;QACV,YAAY,EAAE,mBAAmB;KAClC,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FrameBufferWriter } from '
|
|
1
|
+
import type { FrameBufferWriter } from '@ain1084/audio-frame-buffer';
|
|
2
2
|
/**
|
|
3
3
|
* FrameBufferFiller interface
|
|
4
4
|
* This interface defines a method to fill audio frames into a buffer.
|
|
@@ -6,7 +6,7 @@ import type { FrameBufferWriter } from './buffer-writer';
|
|
|
6
6
|
export interface FrameBufferFiller {
|
|
7
7
|
/**
|
|
8
8
|
* Fill the buffer with audio frames using the provided writer.
|
|
9
|
-
* @param writer - An instance of FrameBufferWriter used to write audio frames to the buffer.
|
|
9
|
+
* @param writer - An instance of {@link https://ain1084.github.io/audio-frame-buffer/classes/FrameBufferWriter.html | FrameBufferWriter} used to write audio frames to the buffer.
|
|
10
10
|
* @returns A boolean indicating whether to continue playback.
|
|
11
11
|
*/
|
|
12
12
|
fill(writer: FrameBufferWriter): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame-buffer-filler.js","sourceRoot":"","sources":["../src/frame-buffer-filler.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { StopEvent, UnderrunEvent } from './events';
|
|
2
2
|
export type { OutputStreamNode } from './output-stream-node';
|
|
3
|
-
export type { FrameBufferWriter } from '
|
|
4
|
-
export type { FrameBufferFiller } from './frame-buffer
|
|
3
|
+
export type { FrameBufferWriter } from '@ain1084/audio-frame-buffer';
|
|
4
|
+
export type { FrameBufferFiller } from './frame-buffer-filler';
|
|
5
5
|
export { StreamNodeFactory, type ManualBufferNodeParams, type TimedBufferNodeParams, type WorkerBufferNodeParams, } from './stream-node-factory';
|
|
6
6
|
export { BufferFillWorker } from './write-strategy/worker/worker';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BufferWriteStrategy } from './write-strategy/strategy';
|
|
2
|
-
import {
|
|
2
|
+
import { FrameBufferContext } from '@ain1084/audio-frame-buffer';
|
|
3
3
|
/**
|
|
4
4
|
* Stream state
|
|
5
5
|
* Represents the different states of the stream.
|
|
@@ -18,7 +18,7 @@ export declare class OutputStreamNode extends AudioWorkletNode {
|
|
|
18
18
|
/**
|
|
19
19
|
* Creates an instance of OutputStreamNode.
|
|
20
20
|
* @param baseAudioContext - The audio context to use.
|
|
21
|
-
* @param
|
|
21
|
+
* @param bufferContext - The context for the audio frame buffer.
|
|
22
22
|
* @param strategy - The strategy for writing to the buffer.
|
|
23
23
|
*/
|
|
24
24
|
private constructor();
|
|
@@ -26,11 +26,11 @@ export declare class OutputStreamNode extends AudioWorkletNode {
|
|
|
26
26
|
* @internal
|
|
27
27
|
* Creates an instance of OutputStreamNode.
|
|
28
28
|
* @param audioContext - The audio context to use.
|
|
29
|
-
* @param
|
|
29
|
+
* @param context - The context for the audio frame buffer.
|
|
30
30
|
* @param strategy - The strategy for writing to the buffer.
|
|
31
31
|
* @returns A promise that resolves to an instance of OutputStreamNode.
|
|
32
32
|
*/
|
|
33
|
-
static create(audioContext: BaseAudioContext,
|
|
33
|
+
static create(audioContext: BaseAudioContext, context: FrameBufferContext, strategy: BufferWriteStrategy): Promise<OutputStreamNode>;
|
|
34
34
|
/**
|
|
35
35
|
* Start playback.
|
|
36
36
|
* The node must be connected before starting playback using connect() method.
|
|
@@ -13,29 +13,29 @@ export class OutputStreamNode extends AudioWorkletNode {
|
|
|
13
13
|
/**
|
|
14
14
|
* Creates an instance of OutputStreamNode.
|
|
15
15
|
* @param baseAudioContext - The audio context to use.
|
|
16
|
-
* @param
|
|
16
|
+
* @param bufferContext - The context for the audio frame buffer.
|
|
17
17
|
* @param strategy - The strategy for writing to the buffer.
|
|
18
18
|
*/
|
|
19
|
-
constructor(baseAudioContext,
|
|
19
|
+
constructor(baseAudioContext, bufferContext, strategy) {
|
|
20
20
|
super(baseAudioContext, PROCESSOR_NAME, {
|
|
21
|
-
outputChannelCount: [
|
|
22
|
-
processorOptions:
|
|
21
|
+
outputChannelCount: [bufferContext.samplesPerFrame],
|
|
22
|
+
processorOptions: bufferContext,
|
|
23
23
|
});
|
|
24
24
|
this._strategy = strategy;
|
|
25
|
-
this._totalWriteFrames =
|
|
26
|
-
this._totalReadFrames =
|
|
25
|
+
this._totalWriteFrames = bufferContext.totalWriteFrames;
|
|
26
|
+
this._totalReadFrames = bufferContext.totalReadFrames;
|
|
27
27
|
this.port.onmessage = this.handleMessage.bind(this);
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* @internal
|
|
31
31
|
* Creates an instance of OutputStreamNode.
|
|
32
32
|
* @param audioContext - The audio context to use.
|
|
33
|
-
* @param
|
|
33
|
+
* @param context - The context for the audio frame buffer.
|
|
34
34
|
* @param strategy - The strategy for writing to the buffer.
|
|
35
35
|
* @returns A promise that resolves to an instance of OutputStreamNode.
|
|
36
36
|
*/
|
|
37
|
-
static async create(audioContext,
|
|
38
|
-
const node = new OutputStreamNode(audioContext,
|
|
37
|
+
static async create(audioContext, context, strategy) {
|
|
38
|
+
const node = new OutputStreamNode(audioContext, context, strategy);
|
|
39
39
|
if (!(await strategy.onInit(node))) {
|
|
40
40
|
throw new Error('Failed to onInit.');
|
|
41
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-stream-node.js","sourceRoot":"","sources":["../src/output-stream-node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA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AAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAA;IAC/C,CAAC;IAED;;;;;;OAMG;IACH,IAAW,gBAAgB;QACzB,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAA;IAChD,CAAC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FrameBufferReader } from '
|
|
1
|
+
import { FrameBufferReader } from '@ain1084/audio-frame-buffer';
|
|
2
2
|
import { PROCESSOR_NAME } from './constants';
|
|
3
3
|
/**
|
|
4
4
|
* OutputStreamProcessor class
|
|
@@ -71,13 +71,13 @@ class OutputStreamProcessor extends AudioWorkletProcessor {
|
|
|
71
71
|
process(_inputs, outputs) {
|
|
72
72
|
const output = outputs[0];
|
|
73
73
|
const samplesPerFrame = output.length;
|
|
74
|
-
const readFrames = this._frameReader.read((
|
|
75
|
-
const bufferFrameCount =
|
|
74
|
+
const readFrames = this._frameReader.read((segment, offset) => {
|
|
75
|
+
const bufferFrameCount = segment.frameCount;
|
|
76
76
|
const frameCount = Math.min(bufferFrameCount, output[0].length - offset);
|
|
77
77
|
// Deinterleaves interleaved audio frame data and writes it to the output.
|
|
78
78
|
output.forEach((outputChannel, channelIndex) => {
|
|
79
79
|
for (let i = channelIndex, j = 0; j < frameCount; i += samplesPerFrame, ++j) {
|
|
80
|
-
outputChannel[offset + j] =
|
|
80
|
+
outputChannel[offset + j] = segment.samples[i];
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
return frameCount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-stream-processor.js","sourceRoot":"","sources":["../src/output-stream-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"output-stream-processor.js","sourceRoot":"","sources":["../src/output-stream-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA2B,MAAM,6BAA6B,CAAA;AACxF,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AI,CAAC,WAAW,EAAE,CAAC;YACrB,IAAI,CAAC,cAAc,EAAE,CAAA;YACrB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,oBAAoB,EAAE,WAAW,EAAwB,CAAC,CAAA;YAChG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAA;YACjB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,UAAU,CAAA;QACpD,iDAAiD;QACjD,IAAI,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;QACrC,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAED,iBAAiB,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OutputStreamNode } from './output-stream-node';
|
|
2
|
-
import type { FrameBufferFiller } from './frame-buffer
|
|
3
|
-
import { FrameBufferWriter } from '
|
|
2
|
+
import type { FrameBufferFiller } from './frame-buffer-filler';
|
|
3
|
+
import { FrameBufferWriter } from '@ain1084/audio-frame-buffer';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for creating a manual buffer node.
|
|
6
6
|
* Used in the {@link StreamNodeFactory.createManualBufferNode} function.
|
|
@@ -8,8 +8,8 @@ import { FrameBufferWriter } from './frame-buffer/buffer-writer';
|
|
|
8
8
|
export type ManualBufferNodeParams = {
|
|
9
9
|
/** The number of audio channels. */
|
|
10
10
|
readonly channelCount: number;
|
|
11
|
-
/** The
|
|
12
|
-
readonly
|
|
11
|
+
/** The count of the frame buffer in frames. */
|
|
12
|
+
readonly frameCount: number;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* Parameters for creating a timed buffer node.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import processor from './output-stream-processor?worker&url';
|
|
2
2
|
import { ManualBufferWriteStrategy } from './write-strategy/manual-strategy';
|
|
3
|
-
import {
|
|
3
|
+
import { createFillerFrameBufferContext } from './filler-frame-buffer-context';
|
|
4
4
|
import { TimedBufferWriteStrategy } from './write-strategy/timed-strategy';
|
|
5
|
+
import { createFrameBufferContext } from '@ain1084/audio-frame-buffer';
|
|
5
6
|
import { WorkerBufferWriteStrategy } from './write-strategy/worker-strategy';
|
|
6
7
|
/**
|
|
7
8
|
* StreamNodeFactory class
|
|
@@ -49,12 +50,12 @@ export class StreamNodeFactory {
|
|
|
49
50
|
if (params.channelCount <= 0 || !Number.isInteger(params.channelCount)) {
|
|
50
51
|
throw new Error('Invalid channelCount: must be a positive integer.');
|
|
51
52
|
}
|
|
52
|
-
if (params.
|
|
53
|
-
throw new Error('Invalid
|
|
53
|
+
if (params.frameCount <= 0 || !Number.isInteger(params.frameCount)) {
|
|
54
|
+
throw new Error('Invalid frameCount: must be a positive integer.');
|
|
54
55
|
}
|
|
55
|
-
const
|
|
56
|
-
const strategy = new ManualBufferWriteStrategy(
|
|
57
|
-
return [await this._outputStreamNodeFactory.create(this.audioContext,
|
|
56
|
+
const context = createFrameBufferContext({ ...params });
|
|
57
|
+
const strategy = new ManualBufferWriteStrategy(context);
|
|
58
|
+
return [await this._outputStreamNodeFactory.create(this.audioContext, context, strategy), strategy.writer];
|
|
58
59
|
}
|
|
59
60
|
/**
|
|
60
61
|
* Creates an OutputStreamNode with timed buffer writing strategy.
|
|
@@ -68,7 +69,7 @@ export class StreamNodeFactory {
|
|
|
68
69
|
}
|
|
69
70
|
StreamNodeFactory.validateTimedBufferNodeParams(params);
|
|
70
71
|
const paramsWithSampleRate = StreamNodeFactory.applySampleRateToParams(params, this._audioContext.sampleRate);
|
|
71
|
-
const config =
|
|
72
|
+
const config = createFillerFrameBufferContext(paramsWithSampleRate);
|
|
72
73
|
return this._outputStreamNodeFactory.create(this.audioContext, config, new TimedBufferWriteStrategy(config, frameFiller));
|
|
73
74
|
}
|
|
74
75
|
/**
|
|
@@ -80,7 +81,7 @@ export class StreamNodeFactory {
|
|
|
80
81
|
async createWorkerBufferNode(worker, params) {
|
|
81
82
|
StreamNodeFactory.validateTimedBufferNodeParams(params);
|
|
82
83
|
const paramsWithSampleRate = StreamNodeFactory.applySampleRateToParams(params, this._audioContext.sampleRate);
|
|
83
|
-
const config =
|
|
84
|
+
const config = createFillerFrameBufferContext(paramsWithSampleRate);
|
|
84
85
|
return this._outputStreamNodeFactory.create(this._audioContext, config, new WorkerBufferWriteStrategy(config, worker, params.fillerParams));
|
|
85
86
|
}
|
|
86
87
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-node-factory.js","sourceRoot":"","sources":["../src/stream-node-factory.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,sCAAsC,CAAA;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAA;AAC5E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"stream-node-factory.js","sourceRoot":"","sources":["../src/stream-node-factory.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,sCAAsC,CAAA;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAA;AAC5E,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAA;AAE9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AAE1E,OAAO,EAAqB,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAA;AA2C5E;;;;;GAKG;AACH,MAAM,OAAO,iBAAiB;IACpB,aAAa,CAAc;IAClB,wBAAwB,CAAyB;IAElE;;;;OAIG;IACH,YAAoB,OAAqB,EAAE,uBAAgD;QACzF,IAAI,CAAC,aAAa,GAAG,OAAO,CAAA;QAC5B,IAAI,CAAC,wBAAwB,GAAG,uBAAuB,CAAA;IAC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;QACtE,CAAC;QAED,2DAA2D;QAC3D,IAAI,MAAM,CAAC,YAAY,KAAK,SAAS,IAAI,CAAC,OAAO,MAAM,CAAC,YAAY,KAAK,QAAQ,IAAI,MAAM,CAAC,YAAY,IAAI,CAAC,CAAC,EAAE,CAAC;YAC/G,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;QACrE,CAAC;QAED,iEAAiE;QACjE,IAAI,MAAM,CAAC,iBAAiB,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,MAAM,CAAC,iBAAiB,IAAI,CAAC,CAAC,EAAE,CAAC;YAC7H,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;QAC3E,CAAC;IACH,CAAC;IAED;;;;;;;;OAQG;IACK,MAAM,CAAC,uBAAuB,CAAC,MAA6B,EAAE,iBAAyB;QAC7F,OAAO;YACL,GAAG,MAAM;YACT,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,iBAAiB;SACnD,CAAA;IACH,CAAC;IAED;;;OAGG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAA;IAC3B,CAAC;CACF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { BufferWriteStrategy } from './strategy';
|
|
2
|
-
import type
|
|
3
|
-
import { FrameBufferWriter } from '../frame-buffer/buffer-writer';
|
|
2
|
+
import { type FrameBufferContext, FrameBufferWriter } from '@ain1084/audio-frame-buffer';
|
|
4
3
|
/**
|
|
5
4
|
* ManualBufferWriteStrategy class
|
|
6
5
|
* Implements the BufferWriteStrategy interface for manually writing to the buffer.
|
|
@@ -9,9 +8,9 @@ export declare class ManualBufferWriteStrategy implements BufferWriteStrategy {
|
|
|
9
8
|
private readonly _writer;
|
|
10
9
|
/**
|
|
11
10
|
* Creates an instance of ManualBufferWriteStrategy.
|
|
12
|
-
* @param
|
|
11
|
+
* @param bufferContext - The configuration for the frame buffer.
|
|
13
12
|
*/
|
|
14
|
-
constructor(
|
|
13
|
+
constructor(bufferContext: FrameBufferContext);
|
|
15
14
|
/**
|
|
16
15
|
* Gets the FrameBufferWriter instance.
|
|
17
16
|
* @returns The FrameBufferWriter instance.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FrameBufferWriter } from '
|
|
1
|
+
import { FrameBufferWriter } from '@ain1084/audio-frame-buffer';
|
|
2
2
|
/**
|
|
3
3
|
* ManualBufferWriteStrategy class
|
|
4
4
|
* Implements the BufferWriteStrategy interface for manually writing to the buffer.
|
|
@@ -7,10 +7,10 @@ export class ManualBufferWriteStrategy {
|
|
|
7
7
|
_writer;
|
|
8
8
|
/**
|
|
9
9
|
* Creates an instance of ManualBufferWriteStrategy.
|
|
10
|
-
* @param
|
|
10
|
+
* @param bufferContext - The configuration for the frame buffer.
|
|
11
11
|
*/
|
|
12
|
-
constructor(
|
|
13
|
-
this._writer = new FrameBufferWriter(
|
|
12
|
+
constructor(bufferContext) {
|
|
13
|
+
this._writer = new FrameBufferWriter(bufferContext);
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Gets the FrameBufferWriter instance.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manual-strategy.js","sourceRoot":"","sources":["../../src/write-strategy/manual-strategy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manual-strategy.js","sourceRoot":"","sources":["../../src/write-strategy/manual-strategy.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAExF;;;IAGI;AACJ,MAAM,OAAO,yBAAyB;IACnB,OAAO,CAAmB;IAE3C;;;OAGG;IACH,YAAY,aAAiC;QAC3C,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAiB,CAAC,aAAa,CAAC,CAAA;IACrD,CAAC;IAED;;;OAGG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAC,4BAA4B;QACvC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;OAIG;IACH,OAAO,EAAC,4BAA4B;QAClC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,SAAS,KAAU,CAAC;CACrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BufferWriteStrategy } from './strategy';
|
|
2
|
-
import type {
|
|
3
|
-
import type { FrameBufferFiller } from '../frame-buffer
|
|
2
|
+
import type { FillerFrameBufferContext } from '../filler-frame-buffer-context';
|
|
3
|
+
import type { FrameBufferFiller } from '../frame-buffer-filler';
|
|
4
4
|
import type { OutputStreamNode } from '../output-stream-node';
|
|
5
5
|
/**
|
|
6
6
|
* TimedBufferWriteStrategy class
|
|
@@ -14,10 +14,10 @@ export declare class TimedBufferWriteStrategy implements BufferWriteStrategy {
|
|
|
14
14
|
private _context;
|
|
15
15
|
/**
|
|
16
16
|
* Creates an instance of TimedBufferWriteStrategy.
|
|
17
|
-
* @param
|
|
17
|
+
* @param bufferContext - The configuration for the filler frame buffer.
|
|
18
18
|
* @param filler - The FrameBufferFiller instance.
|
|
19
19
|
*/
|
|
20
|
-
constructor(
|
|
20
|
+
constructor(bufferContext: FillerFrameBufferContext, filler: FrameBufferFiller);
|
|
21
21
|
/**
|
|
22
22
|
* Initializes the strategy.
|
|
23
23
|
* @returns A promise that resolves to true when initialization is complete.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FrameBufferWriter } from '
|
|
1
|
+
import { FrameBufferWriter } from '@ain1084/audio-frame-buffer';
|
|
2
2
|
/**
|
|
3
3
|
* PlayContext class
|
|
4
4
|
* Manages the buffer filling process using a timer.
|
|
@@ -50,13 +50,13 @@ export class TimedBufferWriteStrategy {
|
|
|
50
50
|
_context = null;
|
|
51
51
|
/**
|
|
52
52
|
* Creates an instance of TimedBufferWriteStrategy.
|
|
53
|
-
* @param
|
|
53
|
+
* @param bufferContext - The configuration for the filler frame buffer.
|
|
54
54
|
* @param filler - The FrameBufferFiller instance.
|
|
55
55
|
*/
|
|
56
|
-
constructor(
|
|
57
|
-
this._writer = new FrameBufferWriter(
|
|
56
|
+
constructor(bufferContext, filler) {
|
|
57
|
+
this._writer = new FrameBufferWriter(bufferContext);
|
|
58
58
|
this._filler = filler;
|
|
59
|
-
this._interval =
|
|
59
|
+
this._interval = bufferContext.fillInterval;
|
|
60
60
|
this._isContinuePlayback = this._filler.fill(this._writer);
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timed-strategy.js","sourceRoot":"","sources":["../../src/write-strategy/timed-strategy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"timed-strategy.js","sourceRoot":"","sources":["../../src/write-strategy/timed-strategy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAI/D;;;GAGG;AACH,MAAM,WAAW;IACP,QAAQ,GAAW,CAAC,CAAA;IAE5B;;;;;;OAMG;IACH,YAAY,IAAsB,EAAE,MAAyB,EAAE,MAAyB,EAAE,YAAoB;QAC5G,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE;YACtC,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACpC,OAAM;YACR,CAAC;YACD,IAAI,CAAC;gBACH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;oBACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;gBAC/B,CAAC;YACH,CAAC;YACD,MAAM,CAAC;gBACL,IAAI,CAAC,OAAO,EAAE,CAAA;gBACd,IAAI,CAAC,IAAI,EAAE,CAAA;YACb,CAAC;QACH,CAA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C,QAAQ,EAAE,OAAO,EAAE,CAAA;QACxB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA;IACtB,CAAC;CACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FillerFrameBufferContext } from '../../filler-frame-buffer-context';
|
|
2
2
|
/**
|
|
3
3
|
* Message sent from the main thread to the worker.
|
|
4
4
|
*
|
|
5
5
|
* @typeParam FillerParams - The type of the parameters for the FrameBufferFiller.
|
|
6
6
|
*
|
|
7
7
|
* For 'init' messages:
|
|
8
|
-
* @property
|
|
8
|
+
* @property context - The context for the filler frame buffer.
|
|
9
9
|
* @property fillerParams - The parameters for the FrameBufferFiller.
|
|
10
10
|
*
|
|
11
11
|
* For 'start' messages:
|
|
@@ -23,7 +23,7 @@ import type { FillerFrameBufferConfig } from '../../frame-buffer/buffer-config';
|
|
|
23
23
|
*/
|
|
24
24
|
export type MessageToWorker<FillerParams> = {
|
|
25
25
|
type: 'init';
|
|
26
|
-
config:
|
|
26
|
+
config: FillerFrameBufferContext;
|
|
27
27
|
fillerParams: FillerParams;
|
|
28
28
|
} | {
|
|
29
29
|
type: 'start';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FrameBufferFiller } from '../../frame-buffer
|
|
1
|
+
import type { FrameBufferFiller } from '../../frame-buffer-filler';
|
|
2
2
|
/**
|
|
3
3
|
* BufferFillWorker class
|
|
4
4
|
* Manages the communication between the main thread and the worker.
|
|
@@ -22,7 +22,7 @@ export declare class BufferFillWorker<FillerParams> {
|
|
|
22
22
|
private handleMessage;
|
|
23
23
|
/**
|
|
24
24
|
* Initializes the worker context.
|
|
25
|
-
* @param
|
|
25
|
+
* @param bufferContext - The configuration for the filler frame buffer.
|
|
26
26
|
* @param params - The parameters for the FrameBufferFiller.
|
|
27
27
|
*/
|
|
28
28
|
private init;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FrameBufferWriter } from '
|
|
1
|
+
import { FrameBufferWriter } from '@ain1084/audio-frame-buffer';
|
|
2
2
|
/**
|
|
3
3
|
* Context class
|
|
4
4
|
* Manages the buffer filling process within a web worker.
|
|
@@ -11,13 +11,13 @@ class Context {
|
|
|
11
11
|
_timerId = 0;
|
|
12
12
|
/**
|
|
13
13
|
* Creates an instance ofContext.
|
|
14
|
-
* @param
|
|
14
|
+
* @param context - The configuration for the filler frame buffer.
|
|
15
15
|
* @param frameBufferFiller - The FrameBufferFiller instance.
|
|
16
16
|
*/
|
|
17
|
-
constructor(
|
|
18
|
-
this._frameBufferWriter = new FrameBufferWriter(
|
|
17
|
+
constructor(context, frameBufferFiller) {
|
|
18
|
+
this._frameBufferWriter = new FrameBufferWriter(context);
|
|
19
19
|
this._frameBufferFiller = frameBufferFiller;
|
|
20
|
-
this._fillInterval =
|
|
20
|
+
this._fillInterval = context.fillInterval;
|
|
21
21
|
this._isContinuePlayback = this.fillBuffer();
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
@@ -104,15 +104,15 @@ export class BufferFillWorker {
|
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
106
106
|
* Initializes the worker context.
|
|
107
|
-
* @param
|
|
107
|
+
* @param bufferContext - The configuration for the filler frame buffer.
|
|
108
108
|
* @param params - The parameters for the FrameBufferFiller.
|
|
109
109
|
*/
|
|
110
|
-
async init(
|
|
110
|
+
async init(bufferContext, params) {
|
|
111
111
|
if (this._context) {
|
|
112
112
|
throw new Error('Error: Context is already created.');
|
|
113
113
|
}
|
|
114
114
|
await this._init?.();
|
|
115
|
-
this._context = new Context(
|
|
115
|
+
this._context = new Context(bufferContext, new this._frameBufferFillerGenerator(params));
|
|
116
116
|
self.postMessage({ type: 'init-done' });
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../src/write-strategy/worker/worker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|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AAC,aAAuC,EAAE,MAAoB;QAC9E,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;QACvD,CAAC;QACD,MAAM,IAAI,CAAC,KAAK,EAAE,EAAE,CAAA;QACpB,IAAI,CAAC,QAAQ,GAAG,IAAI,OAAO,CAAC,aAAa,EAAE,IAAI,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC,CAAA;QACxF,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,WAAW,EAAuB,CAAC,CAAA;IAC9D,CAAC;IAED;;OAEG;IACK,KAAK;QACX,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;QACnD,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAA;IACvB,CAAC;IAED;;OAEG;IACK,IAAI;QACV,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;QACnD,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAA;IACtB,CAAC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BufferWriteStrategy } from './strategy';
|
|
2
|
-
import type {
|
|
2
|
+
import type { FillerFrameBufferContext } from '../filler-frame-buffer-context';
|
|
3
3
|
import type { OutputStreamNode } from '../output-stream-node';
|
|
4
4
|
/**
|
|
5
5
|
* WorkerBufferWriteStrategy class
|
|
@@ -10,11 +10,11 @@ export declare class WorkerBufferWriteStrategy<FillerParam> implements BufferWri
|
|
|
10
10
|
private _context;
|
|
11
11
|
/**
|
|
12
12
|
* Creates an instance of WorkerBufferWriteStrategy.
|
|
13
|
-
* @param
|
|
13
|
+
* @param bufferContext - The context for the filler frame buffer.
|
|
14
14
|
* @param workerConstructor - The constructor for the Worker.
|
|
15
15
|
* @param fillerParam - The parameters for the FrameBufferFiller.
|
|
16
16
|
*/
|
|
17
|
-
constructor(
|
|
17
|
+
constructor(bufferContext: FillerFrameBufferContext, workerConstructor: new () => Worker, fillerParam: FillerParam);
|
|
18
18
|
/**
|
|
19
19
|
* Initializes the strategy.
|
|
20
20
|
* @param node - The OutputStreamNode instance.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
class Context {
|
|
6
6
|
_node;
|
|
7
|
-
|
|
7
|
+
_bufferContext;
|
|
8
8
|
_fillerParam;
|
|
9
9
|
_worker;
|
|
10
10
|
/**
|
|
@@ -13,7 +13,7 @@ class Context {
|
|
|
13
13
|
*/
|
|
14
14
|
constructor(params) {
|
|
15
15
|
this._node = params.node;
|
|
16
|
-
this.
|
|
16
|
+
this._bufferContext = params.context;
|
|
17
17
|
this._worker = new params.workerConstructor();
|
|
18
18
|
this._fillerParam = params.fillerParam;
|
|
19
19
|
this._worker.onmessage = this.handleWorkerMessage.bind(this);
|
|
@@ -45,7 +45,7 @@ class Context {
|
|
|
45
45
|
return new Promise((resolve) => {
|
|
46
46
|
const message = {
|
|
47
47
|
type: 'init',
|
|
48
|
-
config: this.
|
|
48
|
+
config: this._bufferContext,
|
|
49
49
|
fillerParams: this._fillerParam,
|
|
50
50
|
};
|
|
51
51
|
this._worker.postMessage(message);
|
|
@@ -84,12 +84,12 @@ export class WorkerBufferWriteStrategy {
|
|
|
84
84
|
_context = null;
|
|
85
85
|
/**
|
|
86
86
|
* Creates an instance of WorkerBufferWriteStrategy.
|
|
87
|
-
* @param
|
|
87
|
+
* @param bufferContext - The context for the filler frame buffer.
|
|
88
88
|
* @param workerConstructor - The constructor for the Worker.
|
|
89
89
|
* @param fillerParam - The parameters for the FrameBufferFiller.
|
|
90
90
|
*/
|
|
91
|
-
constructor(
|
|
92
|
-
this._createPlayContext = (node) => Context.create({ node,
|
|
91
|
+
constructor(bufferContext, workerConstructor, fillerParam) {
|
|
92
|
+
this._createPlayContext = (node) => Context.create({ node, context: bufferContext, workerConstructor, fillerParam });
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
95
|
* Initializes the strategy.
|