Skip to content

Add Live Reference AEC browser sample - #305

Draft
kkchandi wants to merge 1 commit into
mainfrom
add-client-ec-reference-sample
Draft

Add Live Reference AEC browser sample#305
kkchandi wants to merge 1 commit into
mainfrom
add-client-ec-reference-sample

Conversation

@kkchandi

@kkchandi kkchandi commented Jul 22, 2026

Copy link
Copy Markdown

Live Reference AEC (browser sample)

Adds a browser (TypeScript + Vite) sample under javascript/live-reference-aec/ demonstrating Azure Voice Live Reference AEC (client-supplied echo cancellation reference), available at REST api-version 2026-07-15.

What it does

The browser captures the microphone and a tap of the app's own TTS playback, interleaves them into stereo PCM16 (channel 0 = mic, channel 1 = reference) via an AudioWorklet, and streams that to the service so it cancels echo against the exact signal the speaker plays. It waits for the session.updated acknowledgement before streaming, supports barge-in, and surfaces server and response errors.

SDK note (why this stays draft)

The echo cancellation session fields (reference_source, channels) are sent as a documented PLACEHOLDER object cast as any, because the released @azure/ai-voicelive SDK (1.0.0) does not yet serialize them (it strips them at runtime). The placeholder uses the SDK's camelCase keys, so once the GA SDK aligned with api-version 2026-07-15 ships, we pin that version, drop the cast for typed properties, and it works unchanged.

This PR should not be merged until that GA SDK is released.

Included

  • Sample: README.md, index.html, src/ (voiceAssistant.ts, echoCancellationAudio.ts, main.ts), public/stereo-interleaver.js, style.css, package.json, vite.config.ts, tsconfig.json, .gitignore
  • Registered in the root README.md and javascript/README.md indexes

Validation

  • npm run type-check and npm run build pass on GA @azure/ai-voicelive@1.0.0
  • AudioWorklet interleaving unit-tested; Web Audio graph verified via headless integration test (per-channel RMS across idle / tone / barge-in)
  • Reviewed via multiple blind principal-engineer, solution-architect, external-customer, and repo-convention passes; all in-scope findings addressed

Adds a browser (TypeScript + Vite) sample under javascript/live-reference-aec
demonstrating Azure Voice Live Reference AEC (client-supplied echo cancellation
reference), available at api-version 2026-07-15.

The sample captures the microphone and a tap of the app's own TTS playback,
interleaves them into stereo PCM16 (channel 0 = mic, channel 1 = reference)
via an AudioWorklet, and streams that to the service so it cancels echo using
the exact signal the speaker plays. It waits for the session.updated
acknowledgement before streaming, supports barge-in, and surfaces server and
response errors.

The echo cancellation session fields are sent as a documented PLACEHOLDER
object because the released @azure/ai-voicelive SDK (1.0.0) does not yet
serialize them; swap for typed properties and pin that version when the
EC-enabled GA SDK aligned with api-version 2026-07-15 ships.

Also registers the sample in the root and javascript README indexes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 05e97991-c590-4f4c-88e5-72f7e2916564
@kkchandi
kkchandi force-pushed the add-client-ec-reference-sample branch from 8b444d4 to 96a1d07 Compare July 24, 2026 22:41
@kkchandi kkchandi changed the title Add client-side echo cancellation reference sample Add Live Reference AEC browser sample Jul 24, 2026
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.

1 participant