Improve audio capture chunking for more stable STT.
Increase captured WebRTC audio chunk duration to reduce fragmented transcriptions and improve recognition quality in meetings. Made-with: Cursor
This commit is contained in:
parent
77aa4f3d07
commit
3863063984
1 changed files with 3 additions and 2 deletions
|
|
@ -95,8 +95,9 @@ export class AudioCaptureProcedure {
|
|||
let samplesCollected = 0;
|
||||
let skippedSilentChunks = 0;
|
||||
const minRmsThreshold = 0.0015;
|
||||
// Collect ~1 second of audio at native rate before emitting
|
||||
const samplesPerChunk = nativeRate;
|
||||
// Collect ~2 seconds of audio at native rate before emitting.
|
||||
// Larger chunks improve STT stability and reduce fragment transcripts.
|
||||
const samplesPerChunk = nativeRate * 2;
|
||||
const targetRate = 16000;
|
||||
|
||||
processor.onaudioprocess = (e: AudioProcessingEvent) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue