세션 평가와 교수자 분석 보강
This commit is contained in:
parent
5c4ac04e06
commit
fe2796f05a
51 changed files with 4928 additions and 240 deletions
|
|
@ -587,7 +587,20 @@ async function installSyntheticVoiceCapture(
|
|||
if (this.closed) return;
|
||||
probe.workletChunks += 1;
|
||||
const pcm = new Int16Array([0, 1024, -1024, 0]);
|
||||
this.onmessage?.({ data: { type: "chunk", pcm: pcm.buffer } } as MessageEvent);
|
||||
this.onmessage?.({
|
||||
data: {
|
||||
type: "chunk",
|
||||
pcm: pcm.buffer,
|
||||
metrics: {
|
||||
durationMs: 1600,
|
||||
voiceMs: 350,
|
||||
silenceMs: 1250,
|
||||
trailingSilenceMs: 1250,
|
||||
rms: 0.08,
|
||||
peak: 0.64,
|
||||
},
|
||||
},
|
||||
} as MessageEvent);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1001,6 +1014,40 @@ test.describe("voice cascade success path", () => {
|
|||
);
|
||||
}, { timeout: 10_000 })
|
||||
.toBeTruthy();
|
||||
const sentAudioEndControls = (await readVoiceUiProbe(page)).messages
|
||||
.filter(
|
||||
(message) =>
|
||||
message.direction === "sent" &&
|
||||
message.kind === "text" &&
|
||||
message.data?.includes('"audio_end"'),
|
||||
)
|
||||
.map((message) => JSON.parse(message.data ?? "{}") as Record<string, unknown>);
|
||||
expect(
|
||||
sentAudioEndControls.some((control) => {
|
||||
const events = Array.isArray(control.provider_events) ? control.provider_events : [];
|
||||
return (
|
||||
control.format === "pcm" &&
|
||||
control.silence_ms === 1250 &&
|
||||
control.barge_in === false &&
|
||||
events.some((event) => {
|
||||
const record = event as Record<string, unknown>;
|
||||
return (
|
||||
record.type === "voice_activity" &&
|
||||
record.source === "browser_audio_worklet" &&
|
||||
record.duration_ms === 350
|
||||
);
|
||||
}) &&
|
||||
events.some((event) => {
|
||||
const record = event as Record<string, unknown>;
|
||||
return (
|
||||
record.type === "silence" &&
|
||||
record.source === "browser_audio_worklet" &&
|
||||
record.duration_ms === 1250
|
||||
);
|
||||
})
|
||||
);
|
||||
}),
|
||||
).toBeTruthy();
|
||||
|
||||
await expect
|
||||
.poll(async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue