Reemplazar Web Speech API con Edge TTS para soporte de CarPlay/Bluetooth#1
Open
ricardoalfaro wants to merge 1 commit into
Open
Reemplazar Web Speech API con Edge TTS para soporte de CarPlay/Bluetooth#1ricardoalfaro wants to merge 1 commit into
ricardoalfaro wants to merge 1 commit into
Conversation
El problema raíz era que speechSynthesis en iOS usa una sesión de audio diferente a la de CarPlay/Bluetooth, por lo que el audio nunca llegaba al coche ni a dispositivos Bluetooth. No hay forma de corregir esto dentro de la Web Speech API. Solución: reemplazar speechSynthesis con Edge TTS (servicio gratuito de Microsoft, sin API key) que devuelve un MP3, reproducido via <audio>. El elemento <audio> sí enruta correctamente a CarPlay y Bluetooth en iOS. Cambios principales: - app.js: nuevo cliente Edge TTS sobre WebSocket, voces neurales en español e inglés, chunking automático de textos largos, reproducción con <audio> - index.html: agregar elemento <audio id="audioPlayer"> - service-worker.js: bump cache a v2 para forzar actualización en clientes El AudioContext silencioso (workaround previo) se eliminó, ya no es necesario. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
Author
|
bien |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problema
speechSynthesisen iOS Safari usa una sesión de audio distinta a la de CarPlay y Bluetooth. El audio del lector solo salía por el altavoz del teléfono o auriculares, nunca por el sistema de audio del coche ni dispositivos BT. Es una limitación del sistema operativo — no hay forma de corregirla dentro de la Web Speech API.Solución
Reemplazar
speechSynthesiscon Edge TTS de Microsoft: un servicio gratuito (sin API key) que expone un endpoint WebSocket que el navegador Edge usa internamente. La respuesta es un MP3 que se reproduce con un elemento<audio>HTML, que sí enruta correctamente a CarPlay y Bluetooth en iOS.Cambios
app.js(reescritura completa)synthesizeEdgeTTS()sobre WebSocket (wss://speech.platform.bing.com/...)<audio>con gestión de Blob URLsAudioContextsilencioso (workaround que ya no es necesario)MediaSession API, favoritos y localStorageindex.html<audio id="audioPlayer">para reproducciónservice-worker.jsv2para forzar actualización en dispositivos con la versión anteriorNotas para revisar
synthesizeEdgeTTS().