You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.
Here My Codes
(Sorry i dont know how put those codes in box...)
``import 'package:flutter/material.dart';
import 'package:speech_recognition/speech_recognition.dart';
void main() => runApp(MainPage());
class MainPage extends StatelessWidget {
@OverRide
Widget build(BuildContext context) {
}
}
class VoiceHome extends StatefulWidget {
@OverRide
_VoiceHomeState createState() => _VoiceHomeState();
}
class _VoiceHomeState extends State {
SpeechRecognition _speechRecognition;
bool _isAvailable = false;
bool _isListening = false;
String resultText = " ";
@OverRide
void initState() {
super.initState();
initSpeechRecognizer();
}
void initSpeechRecognizer(){
_speechRecognition = SpeechRecognition();
}
//UI
@OverRide
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FloatingActionButton(
child: Icon(Icons.stop),
backgroundColor: Colors.pinkAccent,
onPressed: () {
_speechRecognition.stop().then(
(result) => setState(() => _isListening = result),
);
},
),
FloatingActionButton(
child: Icon(Icons.mic),
backgroundColor: Colors.deepPurple,
onPressed: () {
if (_isAvailable && !_isListening)
_speechRecognition
.listen(locale: "ko_KR")
.then((result) => print('$result'));
},
),
FloatingActionButton(
child: Icon(Icons.cancel),
mini: true,
backgroundColor: Colors.deepOrange,
onPressed: () {
if (_isListening)
_speechRecognition.cancel().then(
(result) => setState(() {
_isListening = result;
resultText = "";
}
),
);
},
),
],
),
}
}``
and Repo https://github.com/loGTve/soundtotexts
When i Debug it and press "mic" button
its shows
`
D/SpeechRecognitionPlugin( 7751): onRmsChanged : -2.12
D/SpeechRecognitionPlugin( 7751): onReadyForSpeech
D/SpeechRecognitionPlugin( 7751): onRmsChanged : -2.12
D/SpeechRecognitionPlugin( 7751): onRmsChanged : -2.12
......
I/chatty ( 7751): uid=10136(com.example.soundtotext) identical 33 lines
D/SpeechRecognitionPlugin( 7751): onRmsChanged : -2.0
D/SpeechRecognitionPlugin( 7751): onError : 6
`
How can i fix it?
The text was updated successfully, but these errors were encountered: