tts_azure 0.0.5 copy "tts_azure: ^0.0.5" to clipboard
tts_azure: ^0.0.5 copied to clipboard

outdated

Text to Speech from Azure. A Flutter package that interacts with the Azure Cognitive Services REST API to convert text to speech.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:tts_azure/tts_azure.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'TTSAzure',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'TTSAzure'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  TTSAzure _ttsazure;
  TextEditingController _controller;
  String _lang = 'es-ES';
  String _shortName = 'es-ES-Pablo-Apollo';
  
  @override
  void initState() {
    _ttsazure = TTSAzure("YOUR_SUBSCRIPTION_ID", "YOUR_REGION_INDENTIFIER");
    _controller = TextEditingController();
    _controller.text = "Hello World!";
    super.initState();
  }

  void _play() {
    _ttsazure.play(_controller.text, _lang, _shortName);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          children: <Widget>[
            ListTile(
              title: TextField(
                maxLines: 10,
                controller: _controller,
              ),
            )
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _play,
        tooltip: 'Speech to Text',
        child: Icon(Icons.play_arrow),
      ),
    );
  }
}
12
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Text to Speech from Azure. A Flutter package that interacts with the Azure Cognitive Services REST API to convert text to speech.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

audioplayer, flutter, http, path_provider, xml

More

Packages that depend on tts_azure