Closed ottlseo closed 7 months ago
Your stream is too big. Reduce the frame size and try your request again.
const getAudioStream = async function* () {
yield {
AudioEvent: {
AudioChunk: encodePCMChunk(chunk),
},
};
};
const getAudioStream = async function* () {
let buffer = Buffer.alloc(0); // 버퍼 초기화
for await (const chunk of microphoneStream) {
buffer = Buffer.concat([buffer, chunk]); // 청크를 버퍼에 추가
while (buffer.length >= CHUNK_LENGTH) {
const audioChunk = buffer.slice(0, CHUNK_LENGTH); // 청크 길이만큼 버퍼에서 잘라내기
buffer = buffer.slice(CHUNK_LENGTH); // 버퍼에서 청크 길이만큼 제거
yield {
AudioEvent: {
AudioChunk: encodePCMChunk(audioChunk),
},
};
}
}
};
After adding language score calculation, transcribe streaming became too slow
1. It depends on an audio chunk size ( &
SAMPLE_RATE
)2. It seems to be relevant to
languageIdentification
feature