Skip to content

Fix typos in evi-typescript-quickstart main.ts file #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions evi/evi-typescript-quickstart/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { appendChatMessage, connectEVI, startAudioCapture } from "./lib";
async function handleOpen() {
console.log("Socket opened");
recorder = await startAudioCapture(socket!);
player.init();
await player.init();
}

async function handleMessage(msg: SubscribeEvent) {
Expand All @@ -35,16 +35,16 @@ import { appendChatMessage, connectEVI, startAudioCapture } from "./lib";
case "user_message":
case "assistant_message":
if (msg.type === "user_message") {
await player.stop(); // stop playback when user speech detected
player.stop();
}
appendChatMessage(chatContainer, msg); // display user and assistant chat messages
appendChatMessage(chatContainer, msg);
break;
case "audio_output":
await player.enqueue(msg); // queue assistant response audio for playback
await player.enqueue(msg);
break;
case "user_interruption":
console.log("User interruption detected.");
await player.stop(); // stop playback when interruption detected
player.stop();
break;
case "error":
console.error(`EVI Error: Code=${msg.code}, Slug=${msg.slug}, Message=${msg.message}`);
Expand Down