@ain1084/audio-worklet-stream 2.0.1 → 2.0.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ain1084/audio-worklet-stream",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"module": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
"docs": "typedoc"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@stylistic/eslint-plugin": "^
|
|
43
|
-
"@types/audioworklet": "^0.0.
|
|
44
|
-
"@types/node": "^
|
|
45
|
-
"@typescript-eslint/parser": "^8.
|
|
46
|
-
"eslint": "^9.
|
|
47
|
-
"globals": "^
|
|
48
|
-
"typedoc": "^0.
|
|
49
|
-
"typescript": "^5.
|
|
50
|
-
"typescript-eslint": "^8.
|
|
51
|
-
"vite": "^
|
|
42
|
+
"@stylistic/eslint-plugin": "^5.7.0",
|
|
43
|
+
"@types/audioworklet": "^0.0.92",
|
|
44
|
+
"@types/node": "^25.0.9",
|
|
45
|
+
"@typescript-eslint/parser": "^8.53.0",
|
|
46
|
+
"eslint": "^9.39.2",
|
|
47
|
+
"globals": "^17.0.0",
|
|
48
|
+
"typedoc": "^0.28.16",
|
|
49
|
+
"typescript": "^5.9.3",
|
|
50
|
+
"typescript-eslint": "^8.53.0",
|
|
51
|
+
"vite": "^7.3.1"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@ain1084/audio-frame-buffer": "^0.2.0"
|
package/src/output-message.ts
CHANGED
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
* const message: MessageToAudioNode = { type: 'underrun', underrunFrameCount: 256 };
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
-
export type MessageToAudioNode
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
export type MessageToAudioNode
|
|
20
|
+
= { type: 'stop', totalProcessedFrames: bigint }
|
|
21
|
+
| { type: 'underrun', underrunFrameCount: number }
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Messages sent from the main thread to the processor.
|
|
@@ -33,5 +33,5 @@ export type MessageToAudioNode =
|
|
|
33
33
|
* const message: MessageToProcessor = { type: 'stop', framePosition: 1000n };
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
export type MessageToProcessor
|
|
37
|
-
|
|
36
|
+
export type MessageToProcessor
|
|
37
|
+
= { type: 'stop', framePosition: bigint }
|
|
@@ -8,15 +8,15 @@ import { FrameBufferContext } from '@ain1084/audio-frame-buffer'
|
|
|
8
8
|
* Stream state
|
|
9
9
|
* Represents the different states of the stream.
|
|
10
10
|
*/
|
|
11
|
-
export type StreamState
|
|
11
|
+
export type StreamState
|
|
12
12
|
// Initial state where playback can start
|
|
13
|
-
| 'ready'
|
|
13
|
+
= | 'ready'
|
|
14
14
|
// State where playback has started
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
| 'started'
|
|
16
|
+
// State where playback is stopping
|
|
17
|
+
| 'stopping'
|
|
18
18
|
// State where playback has stopped
|
|
19
|
-
|
|
19
|
+
| 'stopped'
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* OutputStreamNode class
|
|
@@ -22,10 +22,10 @@ import type { FillerFrameBufferContext } from '../../filler-frame-buffer-context
|
|
|
22
22
|
* };
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
|
-
export type MessageToWorker<FillerParams>
|
|
26
|
-
| { type: 'init', config: FillerFrameBufferContext, fillerParams: FillerParams }
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
export type MessageToWorker<FillerParams>
|
|
26
|
+
= | { type: 'init', config: FillerFrameBufferContext, fillerParams: FillerParams }
|
|
27
|
+
| { type: 'start' }
|
|
28
|
+
| { type: 'stop' }
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Message sent from the worker to the main thread.
|
|
@@ -43,6 +43,6 @@ export type MessageToWorker<FillerParams> =
|
|
|
43
43
|
* };
|
|
44
44
|
* ```
|
|
45
45
|
*/
|
|
46
|
-
export type MessageToStrategy
|
|
47
|
-
| { type: 'init-done' }
|
|
48
|
-
|
|
46
|
+
export type MessageToStrategy
|
|
47
|
+
= | { type: 'init-done' }
|
|
48
|
+
| { type: 'stop', stopFrames: bigint }
|