@absolutejs/voice 0.0.20 → 0.0.21
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/README.md +387 -4
- package/dist/angular/index.d.ts +1 -0
- package/dist/angular/index.js +669 -3
- package/dist/angular/voice-controller.service.d.ts +21 -0
- package/dist/audioConditioning.d.ts +3 -0
- package/dist/client/actions.d.ts +7 -0
- package/dist/client/connection.d.ts +5 -0
- package/dist/client/controller.d.ts +2 -0
- package/dist/client/htmxBootstrap.js +576 -167
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +486 -3
- package/dist/client/microphone.d.ts +4 -2
- package/dist/correction.d.ts +16 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1314 -283
- package/dist/presets.d.ts +13 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +642 -3
- package/dist/react/useVoiceController.d.ts +20 -0
- package/dist/react/useVoiceStream.d.ts +1 -0
- package/dist/store.d.ts +2 -2
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +607 -3
- package/dist/testing/benchmark.d.ts +36 -0
- package/dist/testing/index.js +1453 -241
- package/dist/testing/sessionBenchmark.d.ts +67 -2
- package/dist/testing/stt.d.ts +1 -0
- package/dist/turnDetection.d.ts +5 -1
- package/dist/turnProfiles.d.ts +6 -0
- package/dist/types.d.ts +198 -8
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.js +660 -3
- package/dist/vue/useVoiceController.d.ts +19 -0
- package/fixtures/README.md +9 -0
- package/fixtures/manifest.json +59 -1
- package/fixtures/pcm/dialogue-three-clean.pcm +0 -0
- package/fixtures/pcm/dialogue-three-mixed.pcm +0 -0
- package/fixtures/pcm/dialogue-two-clean.pcm +0 -0
- package/fixtures/pcm/dialogue-two-noisy.pcm +0 -0
- package/package.json +21 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { VoiceControllerOptions, VoiceTurnRecord } from '../types';
|
|
2
|
+
export declare const useVoiceController: <TResult = unknown>(path: string, options?: VoiceControllerOptions) => {
|
|
3
|
+
assistantTexts: import("vue").ShallowRef<string[], string[]>;
|
|
4
|
+
bindHTMX: (options: import("..").VoiceHTMXBindingOptions) => () => void;
|
|
5
|
+
close: () => void;
|
|
6
|
+
endTurn: () => void;
|
|
7
|
+
error: import("vue").Ref<string | null, string | null>;
|
|
8
|
+
isConnected: import("vue").Ref<boolean, boolean>;
|
|
9
|
+
isRecording: import("vue").Ref<boolean, boolean>;
|
|
10
|
+
partial: import("vue").Ref<string, string>;
|
|
11
|
+
recordingError: import("vue").Ref<string | null, string | null>;
|
|
12
|
+
sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
|
|
13
|
+
sessionId: import("vue").Ref<string | null, string | null>;
|
|
14
|
+
startRecording: () => Promise<void>;
|
|
15
|
+
status: import("vue").Ref<import("..").VoiceSessionStatus | "idle", import("..").VoiceSessionStatus | "idle">;
|
|
16
|
+
stopRecording: () => void;
|
|
17
|
+
toggleRecording: () => Promise<void>;
|
|
18
|
+
turns: import("vue").ShallowRef<VoiceTurnRecord<TResult>[], VoiceTurnRecord<TResult>[]>;
|
|
19
|
+
};
|
package/fixtures/README.md
CHANGED
|
@@ -44,5 +44,14 @@ Selected speaker pages:
|
|
|
44
44
|
|
|
45
45
|
- `multiturn-two-clean.pcm`
|
|
46
46
|
- `multiturn-three-mixed.pcm`
|
|
47
|
+
- `dialogue-two-clean.pcm`
|
|
48
|
+
- `dialogue-two-noisy.pcm`
|
|
49
|
+
- `dialogue-three-clean.pcm`
|
|
50
|
+
- `dialogue-three-mixed.pcm`
|
|
47
51
|
|
|
48
52
|
These are synthetic conversation-style fixtures created by concatenating the bundled public-domain base clips with inserted silence to exercise turn commit behavior.
|
|
53
|
+
|
|
54
|
+
- `multiturn-*` are stress fixtures with tighter pauses.
|
|
55
|
+
- `dialogue-*` are dialogue-style fixtures with longer pause boundaries intended to approximate normal guided multi-turn voice use.
|
|
56
|
+
- `dialogue-three-clean` is the clean long-form baseline for multi-turn guided capture.
|
|
57
|
+
- `dialogue-two-noisy` and `dialogue-three-mixed` keep noisy utterances in the dialogue-style set so turn behavior can be compared against a more realistic clean baseline.
|
package/fixtures/manifest.json
CHANGED
|
@@ -136,6 +136,64 @@
|
|
|
136
136
|
],
|
|
137
137
|
"chunkDurationMs": 100,
|
|
138
138
|
"difficulty": "challenging",
|
|
139
|
-
"tags": ["conversation", "multi-turn", "noisy", "synthetic"]
|
|
139
|
+
"tags": ["conversation", "multi-turn", "noisy", "stress", "synthetic"]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"id": "dialogue-two-clean",
|
|
143
|
+
"title": "Dialogue-style two-turn clean conversation",
|
|
144
|
+
"audioPath": "dialogue-two-clean.pcm",
|
|
145
|
+
"expectedText": "GO QUIETLY ALONE NO HARM WILL BEFALL YOU WE PASSED AROUND ATLANTA CROSSED THE CHATTAHOOCHEE AND TRAVELED BACK OVER THE SAME ROUTE ON WHICH WE HAD MADE THE ARDUOUS CAMPAIGN UNDER JOE JOHNSTON",
|
|
146
|
+
"expectedTerms": ["quietly alone", "atlanta", "chattahoochee", "joe johnston"],
|
|
147
|
+
"expectedTurnTexts": [
|
|
148
|
+
"GO QUIETLY ALONE NO HARM WILL BEFALL YOU",
|
|
149
|
+
"WE PASSED AROUND ATLANTA CROSSED THE CHATTAHOOCHEE AND TRAVELED BACK OVER THE SAME ROUTE ON WHICH WE HAD MADE THE ARDUOUS CAMPAIGN UNDER JOE JOHNSTON"
|
|
150
|
+
],
|
|
151
|
+
"chunkDurationMs": 100,
|
|
152
|
+
"difficulty": "clean",
|
|
153
|
+
"tags": ["clean", "conversation", "dialogue-style", "multi-turn", "synthetic"]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"id": "dialogue-two-noisy",
|
|
157
|
+
"title": "Dialogue-style two-turn mixed clean and noisy conversation",
|
|
158
|
+
"audioPath": "dialogue-two-noisy.pcm",
|
|
159
|
+
"expectedText": "GO QUIETLY ALONE NO HARM WILL BEFALL YOU SLIGHT RAINSTORMS ARE LIKELY TO BE ENCOUNTERED IN A TRIP ROUND THE MOUNTAIN BUT ONE MAY EASILY FIND SHELTER BENEATH WELL THATCHED TREES THAT SHED THE RAIN LIKE A ROOF",
|
|
160
|
+
"expectedTerms": ["quietly alone", "rainstorms", "thatched trees"],
|
|
161
|
+
"expectedTurnTexts": [
|
|
162
|
+
"GO QUIETLY ALONE NO HARM WILL BEFALL YOU",
|
|
163
|
+
"SLIGHT RAINSTORMS ARE LIKELY TO BE ENCOUNTERED IN A TRIP ROUND THE MOUNTAIN BUT ONE MAY EASILY FIND SHELTER BENEATH WELL THATCHED TREES THAT SHED THE RAIN LIKE A ROOF"
|
|
164
|
+
],
|
|
165
|
+
"chunkDurationMs": 100,
|
|
166
|
+
"difficulty": "challenging",
|
|
167
|
+
"tags": ["conversation", "dialogue-style", "multi-turn", "noisy", "synthetic"]
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"id": "dialogue-three-clean",
|
|
171
|
+
"title": "Dialogue-style three-turn clean conversation",
|
|
172
|
+
"audioPath": "dialogue-three-clean.pcm",
|
|
173
|
+
"expectedText": "GO QUIETLY ALONE NO HARM WILL BEFALL YOU WE PASSED AROUND ATLANTA CROSSED THE CHATTAHOOCHEE AND TRAVELED BACK OVER THE SAME ROUTE ON WHICH WE HAD MADE THE ARDUOUS CAMPAIGN UNDER JOE JOHNSTON GO QUIETLY ALONE NO HARM WILL BEFALL YOU",
|
|
174
|
+
"expectedTerms": ["quietly alone", "atlanta", "chattahoochee", "joe johnston"],
|
|
175
|
+
"expectedTurnTexts": [
|
|
176
|
+
"GO QUIETLY ALONE NO HARM WILL BEFALL YOU",
|
|
177
|
+
"WE PASSED AROUND ATLANTA CROSSED THE CHATTAHOOCHEE AND TRAVELED BACK OVER THE SAME ROUTE ON WHICH WE HAD MADE THE ARDUOUS CAMPAIGN UNDER JOE JOHNSTON",
|
|
178
|
+
"GO QUIETLY ALONE NO HARM WILL BEFALL YOU"
|
|
179
|
+
],
|
|
180
|
+
"chunkDurationMs": 100,
|
|
181
|
+
"difficulty": "clean",
|
|
182
|
+
"tags": ["clean", "conversation", "dialogue-style", "multi-turn", "synthetic"]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"id": "dialogue-three-mixed",
|
|
186
|
+
"title": "Dialogue-style three-turn mixed conversation",
|
|
187
|
+
"audioPath": "dialogue-three-mixed.pcm",
|
|
188
|
+
"expectedText": "GO QUIETLY ALONE NO HARM WILL BEFALL YOU SLIGHT RAINSTORMS ARE LIKELY TO BE ENCOUNTERED IN A TRIP ROUND THE MOUNTAIN BUT ONE MAY EASILY FIND SHELTER BENEATH WELL THATCHED TREES THAT SHED THE RAIN LIKE A ROOF GO QUIETLY ALONE NO HARM WILL BEFALL YOU",
|
|
189
|
+
"expectedTerms": ["quietly alone", "rainstorms", "thatched trees"],
|
|
190
|
+
"expectedTurnTexts": [
|
|
191
|
+
"GO QUIETLY ALONE NO HARM WILL BEFALL YOU",
|
|
192
|
+
"SLIGHT RAINSTORMS ARE LIKELY TO BE ENCOUNTERED IN A TRIP ROUND THE MOUNTAIN BUT ONE MAY EASILY FIND SHELTER BENEATH WELL THATCHED TREES THAT SHED THE RAIN LIKE A ROOF",
|
|
193
|
+
"GO QUIETLY ALONE NO HARM WILL BEFALL YOU"
|
|
194
|
+
],
|
|
195
|
+
"chunkDurationMs": 100,
|
|
196
|
+
"difficulty": "challenging",
|
|
197
|
+
"tags": ["conversation", "dialogue-style", "multi-turn", "noisy", "synthetic"]
|
|
140
198
|
}
|
|
141
199
|
]
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@absolutejs/voice",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "Voice primitives and Elysia plugin for AbsoluteJS",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,15 +17,35 @@
|
|
|
17
17
|
"author": "Alex Kahn",
|
|
18
18
|
"scripts": {
|
|
19
19
|
"bench:accents": "bun run ./scripts/benchmark-stt.ts all accents",
|
|
20
|
+
"bench:production": "bun run ./scripts/benchmark-production.ts",
|
|
20
21
|
"bench:assemblyai": "bun run ./scripts/benchmark-stt.ts assemblyai",
|
|
21
22
|
"bench:assemblyai:accents": "bun run ./scripts/benchmark-stt.ts assemblyai accents",
|
|
23
|
+
"bench:openai": "bun run ./scripts/benchmark-stt.ts openai",
|
|
24
|
+
"bench:openai:accents": "bun run ./scripts/benchmark-stt.ts openai accents",
|
|
25
|
+
"bench:openai:diag": "bun run ./scripts/benchmark-stt.ts openai --diag",
|
|
22
26
|
"bench:deepgram": "bun run ./scripts/benchmark-stt.ts deepgram",
|
|
23
27
|
"bench:deepgram:accents": "bun run ./scripts/benchmark-stt.ts deepgram accents",
|
|
28
|
+
"bench:deepgram:nova": "bun run ./scripts/benchmark-stt.ts deepgram",
|
|
29
|
+
"bench:deepgram:flux": "DEEPGRAM_MODEL=flux-general-en bun run ./scripts/benchmark-stt.ts deepgram",
|
|
30
|
+
"bench:vs": "bun run ./scripts/benchmark-vs.ts",
|
|
31
|
+
"bench:vs:all": "bun run ./scripts/benchmark-vs.ts all all",
|
|
32
|
+
"bench:vs:all:accents": "bun run ./scripts/benchmark-vs.ts all accents",
|
|
33
|
+
"bench:vs:deepgram": "bun run ./scripts/benchmark-vs.ts deepgram all",
|
|
34
|
+
"bench:vs:deepgram-nova": "bun run ./scripts/benchmark-vs.ts deepgram-nova all",
|
|
35
|
+
"bench:vs:deepgram-flux": "bun run ./scripts/benchmark-vs.ts deepgram-flux all --compare benchmarks/your-vapi-metrics.json",
|
|
36
|
+
"bench:vs:assemblyai": "bun run ./scripts/benchmark-vs.ts assemblyai all",
|
|
37
|
+
"bench:vs:openai": "bun run ./scripts/benchmark-vs.ts openai all",
|
|
24
38
|
"bench:deepgram:sessions": "bun run ./scripts/benchmark-session.ts deepgram",
|
|
39
|
+
"bench:deepgram:hybrid:sessions": "bun run ./scripts/benchmark-session.ts deepgram-hybrid",
|
|
40
|
+
"bench:deepgram:corrected:sessions": "bun run ./scripts/benchmark-session.ts deepgram-corrected",
|
|
41
|
+
"bench:deepgram:openai-hybrid:sessions": "bun run ./scripts/benchmark-session.ts deepgram-openai-hybrid",
|
|
42
|
+
"bench:production:deepgram-flux-noisy-room": "bun run ./scripts/benchmark-production.ts deepgram-flux-noisy-room",
|
|
43
|
+
"bench:production:deepgram-corrected": "bun run ./scripts/benchmark-production.ts deepgram-corrected",
|
|
25
44
|
"bench:resilience": "bun run ./scripts/benchmark-resilience.ts",
|
|
26
45
|
"bench:sessions": "bun run ./scripts/benchmark-session.ts all",
|
|
27
46
|
"bench:stt": "bun run ./scripts/benchmark-stt.ts all",
|
|
28
47
|
"bench:assemblyai:sessions": "bun run ./scripts/benchmark-session.ts assemblyai",
|
|
48
|
+
"bench:openai:sessions": "bun run ./scripts/benchmark-session.ts openai",
|
|
29
49
|
"build": "rm -rf dist && bun build ./src/index.ts ./src/client/index.ts ./src/react/index.ts ./src/vue/index.ts ./src/svelte/index.ts ./src/angular/index.ts ./src/testing/index.ts --outdir dist --target bun --external elysia --external react --external vue --external @angular/core --external @absolutejs/absolute && bun build ./src/client/htmxBootstrap.ts --outdir dist/client --target browser --format esm && tsc --emitDeclarationOnly --project tsconfig.json",
|
|
30
50
|
"format": "prettier --write \"./**/*.{js,jsx,ts,tsx,json,md}\"",
|
|
31
51
|
"lint": "eslint ./src",
|