Fix Firefox streaming: use browser-detected format instead of hardcoded mp3
This commit is contained in:
parent
4ae6b4fbbd
commit
46048a3251
1 changed files with 2 additions and 3 deletions
|
|
@ -149,9 +149,8 @@ export async function speakTextStreaming(text, voice = "alloy", rate = 0.9, mode
|
|||
// Determine if we can use MediaSource for true streaming
|
||||
const mseMime = AUDIO_FORMAT.mseMime;
|
||||
const canStream = mseMime && window.MediaSource && MediaSource.isTypeSupported(mseMime);
|
||||
// For streaming via MSE, request mp3 (only format MSE supports well)
|
||||
// For buffered fallback, use detected format (opus for Firefox)
|
||||
const requestFormat = canStream ? 'mp3' : AUDIO_FORMAT.format;
|
||||
// Request the browser's preferred format (mp3 for Chrome, webm for Firefox)
|
||||
const requestFormat = AUDIO_FORMAT.format;
|
||||
|
||||
console.log(`TTS streaming: canStream=${canStream}, format=${requestFormat}, mseMime=${mseMime}`);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue