flutter_azure_tts 0.1.2
flutter_azure_tts: ^0.1.2 copied to clipboard

Flutter implementation of Microsoft Azure Cognitives Text-To-Speech

flutter_azure_tts #

Flutter implementation of Microsoft Azure Cognitive Text-To-Speech API.

Getting Started #

Initialise the framework with your Region and Subscription key

  AzureTts.init(
      subscriptionKey: "YOUR SUBSCRIPTION KEY",
      region: "YOUR REGION",
      withLogs: true); // enable logs

Get the list of all available voices. And pick a voice to read the text.

// Get available voices
  final voicesResponse = await AzureTts.getAvailableVoices() as VoicesSuccess;
  
  //Pick a Neural voice
  final voice = voicesResponse.voices.where((element) =>
          element.voiceType == "Neural" && element.locale.startsWith("en-"))
      .toList(growable: false)[0];

Request audio file.

  final text = "Microsoft Speech Service Text-to-Speech API";

  TtsParams params = TtsParams(voice: voice, audioFormat: AudioOutputFormat.audio16khz32kBitrateMonoMp3, text: text);
  
  final ttsResponse = await AzureTts.getTts(params) as AudioSuccess;
1
likes
120
pub points
49%
popularity

Publisher

ghuyfel.com

Flutter implementation of Microsoft Azure Cognitives Text-To-Speech

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

build_runner, equatable, http, json_annotation

More

Packages that depend on flutter_azure_tts