A simple wrapper for Google's Text-To-Spech API. Simply list the available voices and convert your text to a mp3 by providing your API key, language code and voicename.
- add the package as a dependency to your
dependencies: flutter: sdk: flutter text_to_speeech_api: ^0.0.1
- Initialize the TextToSpeechService (optional: provide your api key)
TextToSpeechService service = TextToSpeechService('sample api key');
- List the available voices (no api key required)
- Convert your text to a File object (api key required)
File mp3 = await service.textToSpeech( text: 'Hello World', voiceName: 'de-DE-Wavenet-D', audioEncoding: 'MP3', languageCode: 'de-DE' );
- Utilizing this audioplayer plugin you could now play your mp3 file :)
[0.0.1] - 2019-02-19
- Initial release.
- Convert Text to mp3 File
- Get available Voices
A new Flutter project.
Getting Started #
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: text_to_speech_api: ^0.1.0
2. Install it
You can install packages from the command line:
$ flutter pub get
Alternatively, your editor might support
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Feb 18, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.7.1
- pana: 0.13.5
- Flutter: 1.12.13+hotfix.7
Health issues and suggestions
Document public APIs. (-1 points)
13 out of 13 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.
Maintenance issues and suggestions
Support latest dependencies. (-10 points)
The version constraint in
pubspec.yaml does not support the latest published versions for 1 dependency (
|Dart SDK||>=2.0.0-dev.68.0 <3.0.0|