Skip to content

[Refactor] improve the JS example#588

Open
rui-ren wants to merge 3 commits intomainfrom
ruiren/app-js
Open

[Refactor] improve the JS example#588
rui-ren wants to merge 3 commits intomainfrom
ruiren/app-js

Conversation

@rui-ren
Copy link
Copy Markdown
Contributor

@rui-ren rui-ren commented Apr 4, 2026

JS sample refactoring

Refactors the JS live audio transcription sample to make streaming output cleaner and to make microphone audio ingestion more resilient to short event-loop stalls (aligning behavior more closely with the existing C# sample pattern).

Changes:

Adjust transcription printing to skip empty partials and treat is_final as a marker (not a stop condition).
Increase PortAudio chunk size / queue depth to reduce callback frequency and overflow risk.

Copilot AI review requested due to automatic review settings April 4, 2026 04:25
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
foundry-local Ready Ready Preview, Comment Apr 17, 2026 0:24am

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the JS live audio transcription sample to make streaming output cleaner and to make microphone audio ingestion more resilient to short event-loop stalls (aligning behavior more closely with the existing C# sample pattern).

Changes:

  • Adjust transcription printing to skip empty partials and treat is_final as a marker (not a stop condition).
  • Increase PortAudio chunk size / queue depth to reduce callback frequency and overflow risk.
  • Replace “drop-while-backpressured” audio appends with a bounded async append queue and a pump loop.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread samples/js/live-audio-transcription-example/app.js Outdated
@rui-ren
Copy link
Copy Markdown
Contributor Author

rui-ren commented Apr 16, 2026

@copilot resolve the merge conflicts in this pull request

@rui-ren
Copy link
Copy Markdown
Contributor Author

rui-ren commented Apr 17, 2026

@copilot resolve the merge conflicts in this pull request

@rui-ren
Copy link
Copy Markdown
Contributor Author

rui-ren commented Apr 17, 2026

@copilot resolve the merge conflicts in this pull request

…n-example/app.js

Co-authored-by: rui-ren <15321482+rui-ren@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

@copilot resolve the merge conflicts in this pull request

Resolved in 4eb318d. The conflict was a modify/delete conflict — origin/main deleted the entire live-audio-transcription-example/ directory (commit 3eed749) while this branch modified app.js. Merged main in and kept our modified app.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants