Skip to content

[WIP] Optimize audio transcription data handling#572

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/improve-audio-transcription-efficiency
Closed

[WIP] Optimize audio transcription data handling#572
Copilot wants to merge 1 commit intomainfrom
copilot/improve-audio-transcription-efficiency

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

Cloud agent has begun work on sdk/js/src/openai/li... and will update this pull request as work progresses.

Original prompt

sdk/js/src/openai/liveAudioTranscriptionClient.ts
Comment on lines +252 to +255
const copy = new Uint8Array(pcmData.length);
copy.set(pcmData);

    await this.pushQueue!.write(copy);

Copilot AI
29 minutes ago
append() copies pcmData into a new Uint8Array, and executeCommandWithBinary() then copies again via Buffer.from(binaryData). For high-frequency mic chunks this double-copy can be costly; consider queueing a Buffer/ArrayBuffer slice directly or changing executeCommandWithBinary() to avoid the extra copy.

Suggested change
const copy = new Uint8Array(pcmData.length);
copy.set(pcmData);
await this.pushQueue!.write(copy);
await this.pushQueue!.write(pcmData);

    is this a legit recommend ?

Created from VS Code.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 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 1, 2026 5:39am

Request Review

@rui-ren
Copy link
Copy Markdown
Contributor

rui-ren commented Apr 1, 2026

@copilot sdk/js/src/openai/liveAudioTranscriptionClient.ts
Comment on lines +252 to +255
const copy = new Uint8Array(pcmData.length);
copy.set(pcmData);

Copilot AI
29 minutes ago
append() copies pcmData into a new Uint8Array, and executeCommandWithBinary() then copies again via Buffer.from(binaryData). For high-frequency mic chunks this double-copy can be costly; consider queueing a Buffer/ArrayBuffer slice directly or changing executeCommandWithBinary() to avoid the extra copy.

Suggested change
const copy = new Uint8Array(pcmData.length);
copy.set(pcmData);
await this.pushQueue!.write(copy);
await this.pushQueue!.write(pcmData);

@rui-ren rui-ren closed this Apr 1, 2026
Copilot stopped work on behalf of rui-ren due to an error April 1, 2026 05:41
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.

2 participants