Skip to content

Commit 44d747e

Browse files
adk-botcopybara-github
authored andcommitted
chore: update compiled adk web assets
Merge #6322 This PR automatically updates the compiled adk web files in `src/google/adk/cli/browser/` using the assets from `google/adk-web@v1.0.1`. Please review the diff before merging. COPYBARA_INTEGRATE_REVIEW=#6322 from google:update-frontend-assets 8136045 PiperOrigin-RevId: 943677062
1 parent 34b953e commit 44d747e

154 files changed

Lines changed: 6595 additions & 8712 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/google/adk/cli/browser/assets/audio-processor.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2026 Google LLC
2+
* Copyright 2025 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
1717
class AudioProcessor extends AudioWorkletProcessor {
1818
constructor() {
1919
super();
20-
this.targetSampleRate = 22000; // Change to your desired rate
20+
this.targetSampleRate = 16000; // Live API expects 16 kHz PCM input
2121
this.originalSampleRate = sampleRate; // Browser's sample rate
2222
this.resampleRatio = this.originalSampleRate / this.targetSampleRate;
2323
}
@@ -26,7 +26,7 @@ class AudioProcessor extends AudioWorkletProcessor {
2626
const input = inputs[0];
2727
if (input.length > 0) {
2828
let audioData = input[0]; // Get first channel's data
29-
29+
3030
if (this.resampleRatio !== 1) {
3131
audioData = this.resample(audioData);
3232
}
@@ -40,9 +40,15 @@ class AudioProcessor extends AudioWorkletProcessor {
4040
const newLength = Math.round(audioData.length / this.resampleRatio);
4141
const resampled = new Float32Array(newLength);
4242

43+
// Linear interpolation resampling (higher quality than nearest neighbor)
44+
const lastIndex = audioData.length - 1;
4345
for (let i = 0; i < newLength; i++) {
44-
const srcIndex = Math.floor(i * this.resampleRatio);
45-
resampled[i] = audioData[srcIndex]; // Nearest neighbor resampling
46+
const srcPos = i * this.resampleRatio;
47+
const srcIndex = Math.floor(srcPos);
48+
const nextIndex = Math.min(srcIndex + 1, lastIndex);
49+
const frac = srcPos - srcIndex;
50+
resampled[i] =
51+
audioData[srcIndex] * (1 - frac) + audioData[nextIndex] * frac;
4652
}
4753
return resampled;
4854
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"backendUrl": ""
3-
}
3+
}

src/google/adk/cli/browser/chunk-27SWUPRL.js

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/google/adk/cli/browser/chunk-2DLZXFEQ.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)