Add Nemotron samples multi-lang test samples#672
Conversation
Adds JS/C#/Python/Rust/C++ nemotron-focused live audio transcription samples and updates the Rust samples index. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Nemotron samples multi-lang test samples
There was a problem hiding this comment.
Pull request overview
Adds/updates Nemotron live-audio transcription samples across multiple languages to demonstrate real-time microphone (or synthetic) audio ingestion and streaming transcription results using Foundry Local SDKs.
Changes:
- Add new Rust live-audio transcription sample crate + docs and link it from the Rust samples README.
- Add new Python live-audio transcription sample (PyAudio-based) + requirements.
- Update existing JS and C# samples for improved behavior/consistency; add a new C++ synthetic-audio sample.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| samples/rust/live-audio-transcription-example/src/main.rs | New Rust live-audio transcription sample implementation. |
| samples/rust/live-audio-transcription-example/README.md | Run instructions for the new Rust sample. |
| samples/rust/live-audio-transcription-example/Cargo.toml | New Rust sample crate manifest and dependencies. |
| samples/rust/README.md | Adds the new Rust sample to the samples index. |
| samples/python/live-audio-transcription/src/app.py | New Python live microphone transcription sample. |
| samples/python/live-audio-transcription/requirements.txt | Python dependencies for the new sample. |
| samples/js/live-audio-transcription-example/app.js | Updates JS live-audio sample output handling and queue/backpressure behavior. |
| samples/cs/live-audio-transcription-example/Program.cs | Updates EP registration flow to use spinner helper. |
| samples/cpp/live-audio-transcription-example/main.cpp | New C++ sample pushing synthetic PCM and reading streaming/final results. |
| samples/cpp/live-audio-transcription-example/README.md | Documentation for the new C++ sample. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- C++: Use explicit little-endian PCM encoding for portability - C++: Continue on TryGetNext timeout with max-retry guard - Rust: Safe-access r.content via .first() to avoid panic on empty - Rust: Add sleep pacing in --synth mode for realistic ingestion - Rust: Update README run instructions (crate not in workspace) - Rust: Add SDK availability note in README - Python: Add exception handling in capture_mic thread - Python: Add SDK availability note in header comment Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve conflicts: - samples/cs/live-audio-transcription-example/Program.cs: keep (deleted on main) - samples/js/live-audio-transcription-example/app.js: keep (deleted on main) - samples/rust/README.md: adopt main's table format, add live-audio entry - Add SDK availability notes to C++ sample Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The 'local-sdk' source (../../local-packages) was removed in PR #573 and the ORT-Nightly feed was removed in PR #633, leaving only nuget.org. Since Microsoft.AI.Foundry.Local is not published to nuget.org, all C# sample builds fail during NuGet restore. Restore the local-sdk source with package source mapping so the CI 'Build SDK from source' step output is discoverable by sample builds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Map Microsoft.AI.Foundry.Local* to local-sdk so CI-built SDK (0.9.0-dev) is used instead of nuget.org's stable v1.0.0 which lacks newer APIs - Add Microsoft.AI.Foundry.Local.Core* to nuget.org (longest-prefix wins) so Core native packages still resolve from nuget.org - This fixes cs-samples CI failures caused by missing APIs in stable SDK Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Python: add download_and_register_eps() call, platform markers in requirements.txt, clarify forward-looking header comment - JS: add package.json with type:module for ESM support, update README - Rust: add winml feature for Windows, fix resample() panic on empty input, warn on non-f32 CPAL format, clarify README run instructions - C#: replace fire-and-forget AppendAsync with bounded channel pattern, add comment explaining local-packages source in nuget.config Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The cs-samples CI job shows only 'exit code 1' without the actual build errors. Capture build output and emit error lines as ::error:: annotations so they appear in the PR checks tab. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The CI-built SDK transitively depends on Microsoft.Extensions.Logging >= 9.0.15 (via Core.WinML -> WindowsAppSDK). The previous pin to 9.0.10 in Directory.Packages.props caused NU1605 package downgrade errors. Also surface build errors as GitHub annotations for better CI debugging. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… all samples Update the model name from 'nemotron' to 'nemotron-speech-streaming-en-0.6b' in all 5 language samples (JS, C#, Python, Rust, C++). Also align the JS sample with the reference at ruiren/build-js-sdk-packaging (appName, banner). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Mirror the JS sample's naudiodon2 mic capture pattern in C++ using PortAudio: - Background thread reads transcription results (like JS readPromise) - PortAudio callback pushes PCM to bounded AudioQueue (like JS appendQueue) - Main thread pumps queue to session->Append() (like JS pumpAudio) - Ctrl+C graceful shutdown (like JS SIGINT handler) - Falls back to synthetic PCM if PortAudio unavailable or --synth passed - Compile with -DHAS_PORTAUDIO to enable mic capture Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- C++ main.cpp: align with actual SDK API (Manager::Create/Instance, OpenAIAudioClient(*model), Manager::Destroy, download progress callback) - JS app.js: auto-stop session after synthetic audio fallback (prevents hang) - JS package.json: move naudiodon2 to optionalDependencies - C# Program.cs: add OS check for WaveInEvent (Windows-only), add --synth flag and synthetic PCM fallback for non-Windows platforms - C# .sln: fix Any CPU/x86 config mapped to ARM64 -> use proper platforms - Python requirements.txt: remove pyaudio (optional, can break CI); add install instructions as comments - Skip nuget.config comment (longest-prefix-match works correctly) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Add Nemotron live-audio transcription samples across JS, C#, Python, Rust, and C++ in their language-specific sample folders.
What’s included
JavaScript
samples/js/live-audio-transcription-example/app.jsC#
samples/cs/live-audio-transcription-example/Program.csPython
samples/python/live-audio-transcription/src/app.pysamples/python/live-audio-transcription/requirements.txtcreate_live_transcription_sessionpattern)Rust
samples/rust/live-audio-transcription-example/src/main.rssamples/rust/live-audio-transcription-example/Cargo.tomlsamples/rust/live-audio-transcription-example/README.mdsamples/rust/README.mdC++
samples/cpp/live-audio-transcription-example/main.cppsamples/cpp/live-audio-transcription-example/README.mdNotes
.tgz, local temp folders) were intentionally excluded.