-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtext_to_speech.dart
35 lines (35 loc) ยท 1.06 KB
/
text_to_speech.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// import 'package:flutter/material.dart';
// import 'package:flutter_tts/flutter_tts.dart';
//
// class TextToSpeech extends StatelessWidget {
// final FlutterTts flutterTts = FlutterTts();
// final TextEditingController textEditingController = TextEditingController();
//
// TextToSpeech({super.key});
//
// @override
// Widget build(BuildContext context) {
// speak(String text) async {
// await flutterTts.setLanguage("en-US");
// await flutterTts.setPitch(0.8);
// await flutterTts.speak(text);
// }
//
// return Container(
// alignment: Alignment.center,
// child: Padding(
// padding: const EdgeInsets.all(32.0),
// child: Column(
// mainAxisSize: MainAxisSize.min,
// children: <Widget>[
// TextFormField(
// controller: textEditingController,
// ),
// ElevatedButton(onPressed: () => speak(textEditingController.text),
// child: const Text("Start To speech")),
// ],
// ),
// ),
// );
// }
// }