Orientação gerada a partir de informações públicas. Apenas para referência.
O Flutter TTS é um plugin multiplataforma que habilita a funcionalidade de texto para fala em aplicativos Flutter. Ele suporta múltiplas plataformas, incluindo Android, iOS, Web, macOS e Windows, permitindo que desenvolvedores integrem facilmente saída de áudio por voz em seus aplicativos. O plugin fornece APIs simples para converter texto em áudio falado, tornando-o ideal para recursos de acessibilidade, assistentes de voz e ferramentas interativas de aprendizado. Ele utiliza motores nativos de síntese de fala em cada plataforma para desempenho confiável e vozes naturais.
Casos de uso
Recursos de acessibilidade
Navegação com orientação por voz
Aplicativos educacionais
Chatbots interativos
sistemas de feedback de áudio
Principais recursos
Suporte multiplataforma
Integração simples da API
uso do motor de fala nativo
Parâmetros de voz personalizáveis
Reprodução de texto em tempo real
Indicado para
Desenvolvedores de aplicativos acessíveis
criadores de software educacional
Integrações de assistente de voz
Aplicativos que exigem feedback de áudio
Considerações
Requer permissões específicas da plataforma em dispositivos móveis
A disponibilidade de voz varia conforme o dispositivo
Personalização limitada na web
O desempenho depende do motor nativo
Pode exigir permissão do usuário no iOS e no Android
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
Text To Speech
A flutter text to speech plugin (Swift,Kotlin)
Features
[x] Android, iOS, Web, Windows & macOS
[x] speak
[x] stop
[x] get languages
[x] set language
[x] set speech rate
[x] set speech volume
[x] set speech pitch
[x] get voices
[x] set voice
[x] Android, iOS, Web & macOS
[x] is language available
[x] Android, iOS, Web
[x] speech marks (requires iOS 7+, Android 26+, and default voice engine for web)
Progress updates are only supported for native speech synsthesis. Use the default engine to ensure support for progress updates. Chromium#41195426
Android
Change the minimum Android sdk version to 21 (or higher) in your android/app/build.gradle file.
minSdkVersion 21
Update the Kotlin Gradle Plugin Version
Change the verision of the Kotlin Gradle plugin to 1.9.10.
If your project was created with a version of Flutter before 3.19, go to the android/build.gradle file and update the ext.kotlin_version:
ext.kotlin_version = '1.9.10'
Otherwise go to android/settings.gradle and update the verion of the plugin org.jetbrains.kotlin.android:
id "org.jetbrains.kotlin.android" version "1.9.10" apply false
Android TTS does not support the pause function natively, so we have implemented a work around. We utilize the native onRangeStart() method to determine the index of start when pause is invoked. We use that index to create a new text the next time speak is invoked. Due to using onRangeStart(), pause works on SDK versions >= 26. Also, if using start and end offsets inside of setProgressHandler(), you'll need to keep a track of them if using pause since they will update once the new text is created when speak is called after being paused.
await flutterTts.pause()
iOS
There's a known issue with integrating plugins that use Swift into a Flutter project created with the Objective-C template. Flutter#16049
To set audio category and options with optional mode (iOS only). The following setup allows background music and in-app audio session to continue simultaneously: