Skip to content

Commit

Permalink
clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
albho committed Aug 26, 2024
1 parent 47b9241 commit 62e9115
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions recipes/llm-voice-assistant/nodejs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ async function llmVoiceAssistant() {
porcupineProfiler.tock(pcm);
if (isWakeWordDetected) {
if (profile) {
process.stdout.write(`\n[Porcupine RTF: ${porcupineProfiler.rtf()}]\n`);
process.stdout.write(`\n[Porcupine RTF: ${porcupineProfiler.rtf()}]`);
}
process.stdout.write('\n$ Wake word detected, utter your request or question ...');
process.stdout.write('\n\n$ Wake word detected, utter your request or question ...');
process.stdout.write('\n\nUser > ');
}
} else if (!isEndpointReached) {
Expand Down Expand Up @@ -261,7 +261,7 @@ async function llmVoiceAssistant() {
let completion = '';
let isStartedPlaying = false;

process.stdout.write(`\n\nLLM >`);
process.stdout.write(`\nLLM >`);
const res = await pllm.generate(
dialog.prompt(),
{
Expand Down Expand Up @@ -289,8 +289,10 @@ async function llmVoiceAssistant() {
orcaProfiler.tick();
const flushedPcm = orcaStream.flush();
orcaProfiler.tock(flushedPcm);
process.stdout.write(`\n[Orca RTF: ${orcaProfiler.rtf()}]`);
process.stdout.write(`\n[Delay: ${delaySec.toFixed(3)} sec]`);
if (profile) {
process.stdout.write(`\n[Orca RTF: ${orcaProfiler.rtf()}]`);
process.stdout.write(`\n[Delay: ${delaySec.toFixed(3)} sec]`);
}
if (flushedPcm !== null) {
pcmBuffer.push(...flushedPcm);
}
Expand Down

0 comments on commit 62e9115

Please sign in to comment.