Тёмный

Flutter Speech to Text App Tutorial | Voice Recognition 

Marcus Ng
Подписаться 85 тыс.
Просмотров 100 тыс.
50% 1

» Flutter courses, writeups, and source code on Launch Club 🧠
drp.li/Iq9Bk
» Flutter Job Board 👋
drp.li/T9bLq
This Flutter tutorial will teach you how to integrate speech to text capabilities into your app using your device’s microphone and highlight certain words.
» Remember to like, subscribe, comment, and share this video! 🚨
ru-vid.com?sub_...
» Socials📱
GitHub: github.com/MarcusNg
Twitter: / marcuslng
» Resources 📁
Source Code: github.com/MarcusNg/flutter_v...
speech_to_text package: pub.dev/packages/speech_to_text
highlight_text packages: pub.dev/packages/highlight_text
avatar_glow package: pub.dev/packages/avatar_glow
» Timestamps 🕒
00:00 Introduction
00:48 pubspec.yaml
01:12 iOS and Android Permissions
01:55 main.dart
02:17 Speech Screen
2:55 Glowing Floating Action Button
3:50 Displaying Text + Highlighted Text
5:02 Listening Logic
5:58 Thanks for watching!
» Music 🎶
Joakim Karud ( / joakimkarud )
#Flutter #FlutterSpeech #FlutterVoice

Опубликовано:

 

4 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 141   
@muhammadfaizan2461
@muhammadfaizan2461 3 года назад
Simple and straight to the point, really love this video
@Avalanche034
@Avalanche034 3 года назад
So excited to see this you are making some fantastic content
@SaidElnaffar
@SaidElnaffar 3 года назад
Loved it- liked, subscribed, and shared!
@bejanoamer4728
@bejanoamer4728 3 года назад
your channel is gold mate. Thanks from Washington DC
@wilsonowilson4298
@wilsonowilson4298 3 года назад
That intro was smoooooth
@bruceliang6154
@bruceliang6154 3 года назад
omg, i been looking for this so long! thank!!!!!!!!!!!!!!!!!!!!!!
@sinhhungwin
@sinhhungwin 3 года назад
Great content. Plus, your voice is so smooth!
@vinipachecov
@vinipachecov 3 года назад
Awesome content! Subscribed and please keep rocking!
@mamadytraore614
@mamadytraore614 3 года назад
Awesome video. Thank you sooooooo much! Loved and subscribed!
@gabrielowusu1927
@gabrielowusu1927 3 года назад
I always love your content❤❤.
@tsioryfitiavanaanhykrishna6992
@tsioryfitiavanaanhykrishna6992 3 года назад
You are the best bro ! Subscribed!
@santoshsah1393
@santoshsah1393 3 года назад
This video was really helpful
@coucoutier
@coucoutier 3 года назад
Very good tutorial ! What a wonderful language that flutter is !
@AlexGhiurau
@AlexGhiurau Год назад
Dart is the actual language
@davidtantz
@davidtantz Год назад
Simple and straight
@robidahariansyah4360
@robidahariansyah4360 3 года назад
thankss you, this is helped my project
@bburningpirate7087
@bburningpirate7087 Месяц назад
Thankyou so much
@chafroudtarek9392
@chafroudtarek9392 3 года назад
keep going man
@bezelnarrow3799
@bezelnarrow3799 3 года назад
Hay lắm a ơi ^^ Đa tạ ạ !!
@hdalank
@hdalank 3 года назад
Subscribed !!
@ademilsonsantanadasilva8961
@ademilsonsantanadasilva8961 3 года назад
awesome content
@letmeflutter6644
@letmeflutter6644 Год назад
thank you
@atuldev5772
@atuldev5772 3 года назад
Yo man much love from India
@hboleto
@hboleto 2 года назад
Awesome explanation Marcus, helped me a lot. I have one question, it is possible to highlight words that the user said when the confidence level is bellow 50% ?
@umitcelik5508
@umitcelik5508 6 месяцев назад
When the machine said like you hawe to like. 😂
@user-kr9xy4hr2n
@user-kr9xy4hr2n 3 года назад
Awesome
@hbv8560
@hbv8560 3 года назад
Hello Marcus. Thank you for your video. Can you please make video on search page with search bad and different communities boxes on bottom? Thank you
@trapscripting8475
@trapscripting8475 3 года назад
Hey Marcus, please do us a scroll view that loads more content on scroll... Such that it fetches more content only when required. Thank you
@amankwahkingsley9139
@amankwahkingsley9139 3 года назад
Hello I really enjoy your videos. Can I get the tutorials on how to setup vscode for flutter
@Superhost_Sabrina
@Superhost_Sabrina 3 года назад
Hi, thank you for this video! I was wondering what is the use case for this kind of app with this plugin? At the beginning, I wanted my app to have this speech-text functionality, so I was looking for tutorial and trying it in my app. But then I realized our phone already has a button on the bottom-right ride of the keyboard that can record voice/speech and show it to Text field, so if we just have a text field in the app, user can still use speech for inputting text, and in this way, if any text is wrong, you can modify the text with keyboard, so can you tell me why we use this plugin? what are practical usage of this? Thank you!
@ismaelramos4518
@ismaelramos4518 3 года назад
How can I edit the text in case I make a mistake? and how can I put it in a textformfield? help me please great video!!
@venkateshn3956
@venkateshn3956 9 месяцев назад
thanks for the video, is there a way to get word confidence score.
@vidy9754
@vidy9754 3 года назад
brilliant video. Short precise and a GREAT way to ask users to subscribe. Almost played to perfection. i only have one question... where is that variable "val" coming from? can you explain plz?
@tigeruppercut2000
@tigeruppercut2000 9 месяцев назад
They are lambdas functions, meaning they're anonymous functions that are declared on the spot, because you don't really need to declare a whole entire function just to print something in those cases. onStatus, onError etc are events that passes in one string variable, which in this case is "val". And the value is just simply printed out the console log or whereever
@varunlohade383
@varunlohade383 3 года назад
fan!
@danieleangelini6238
@danieleangelini6238 3 года назад
First OF ALL my appreciated for that video awesome! but mic of simulator don't recognized mic how to fix ?
@kadirfurkancaybas580
@kadirfurkancaybas580 10 месяцев назад
Hello , great tutorial still. I wonder, Can we add this a punctation ?
@__________________________6910
@__________________________6910 3 года назад
Great
@kadirhakan-le3sz
@kadirhakan-le3sz 5 месяцев назад
Thanks very much for the video. How can I do this in the form of constant listening? Or how can I run it in the background as an assistant application? Thank you again.
@aprendiendoaprogramar4984
@aprendiendoaprogramar4984 2 года назад
✔✔✔ Greetings, thanks for sharing your knowledge, I don't know if you know any method to navigate between screens using voice. If possible please provide a tutorial on how to do it. Thank you!
@clementbabaniyi
@clementbabaniyi 3 года назад
Wow. cool
@willyjean9137
@willyjean9137 Год назад
Make a video on how to use Text To Speech using google api voices please.
@TheTomdeaf
@TheTomdeaf 3 года назад
Can we use another audio input than a microphone? I need to connect to videos or radio audio files.
@ricardomudinyane5038
@ricardomudinyane5038 3 года назад
Thank you so much for this sir. Can you please help me understand why a little pause in talking stop the recording ?
@siddheshdikonda8828
@siddheshdikonda8828 3 года назад
And how to resolve this problem so that it will work smoothly even we take pause while speak
@joebilly9408
@joebilly9408 3 года назад
With Flutter you could create the opposite of this text app Means we are adding text output is audio
@youcefbenabed4895
@youcefbenabed4895 3 года назад
I just want to know what is the meaning of the confidence value, what is used for?
@loydvincentbutron4345
@loydvincentbutron4345 3 месяца назад
were planning to create app like this but not in english language
@santoshsah1393
@santoshsah1393 3 года назад
Will you make video on Torrent Search Api with Flutter
@praveenpravin9881
@praveenpravin9881 2 года назад
@animeshbanerjee4379
@animeshbanerjee4379 3 года назад
Hey mate .... When it converted speech to text then we can save those texts in local so that we can see those texts letter ? Bt how to save those spoken texts in local storage ? Love from INDIA 🇮🇳
@DDOCTORGaming
@DDOCTORGaming 2 года назад
Is their a way to save the spoken text in a document inside firestore? thanks
@maxmustermann7954
@maxmustermann7954 2 года назад
hey great tutorial, works neatly. Is there a way to trigger the voice recoginition automatically so the user does not have to press a button at all? Similiar to amazons "hey alexa".
@shailenderpal4072
@shailenderpal4072 3 года назад
Can we store this text somewhere or copy maybe?
@gaganraj6707
@gaganraj6707 3 года назад
how to add a list of words which need to be highlighted?
@anmolbindra1
@anmolbindra1 3 года назад
Great Help but small problem - I see a red screen for 1 sec once i press the mic button and then it displayes the speech to text. any idea why a red screen. 2) the mic turns off after 2 seconds automatically in android but the avtarglow dosen't.
@getintocode505
@getintocode505 3 года назад
It will never enter into the else block, then how isListening will be set to False.
@sucifebryani2256
@sucifebryani2256 3 года назад
hello marcus, if i listening then i pause first, and I want to continue the text again, how is that?
@ViciussBr
@ViciussBr Год назад
Is there a way to make it continues ? It works but if the user doesn't speak after a few second then the app wont listen to their speech anymore.
@CANCANAKON
@CANCANAKON 2 года назад
Hi,how we can change language? Is it possible?
@peoncup7641
@peoncup7641 2 года назад
Hey! If I would like to use a .wav file, and convert it to text, could use this API or would I need to go down another route?
@zsthegreat5534
@zsthegreat5534 3 года назад
Can't we save that text?? Is it possible??
@taariqmansurie
@taariqmansurie 3 года назад
how do we save the text which is converted from speech recently to firebase and then reflect it back again ? as I want to save it for my notes and store it in the firebase storage and display the notes in the application itself.......thank you in advance
@MrIMacro
@MrIMacro 9 месяцев назад
Could you please show us how to make this app support Arabic voice recognition?
@leonardkabasa1902
@leonardkabasa1902 6 месяцев назад
Its works well but what if i wanted to increase the duration of the _islistening do I put it at the duration at the end of the val.confidence or at the beginning of the islitening false ?
@y_a_n_y_ilufungula2044
@y_a_n_y_ilufungula2044 Год назад
Hi is there any offline one ?
@prateekdixit3819
@prateekdixit3819 3 года назад
I am getting dart analysis error that "the named parameter ' visualDensity' isn't defined" How do i solve this
@shinigami4228
@shinigami4228 Год назад
How can I make it run everytime in back end ?
@smilingreshmi
@smilingreshmi 3 года назад
great tutorial 👍🏼 i have a question, is the voice input added into an array ? if not, in which one line indicates the result (voice input) because i want use the input to send to another API ?
@mahmoudkhalil4691
@mahmoudkhalil4691 2 года назад
do you want to use that input in translator API?
@smilingreshmi
@smilingreshmi 2 года назад
@@mahmoudkhalil4691 yes and also another api to rhyme the last word said in that sentence.
@mahmoudkhalil4691
@mahmoudkhalil4691 2 года назад
Could you please send to me how to do it logically? If you know
@aqifmontana9886
@aqifmontana9886 3 года назад
Hey man i downloaded it from the github repository and it didn't work as it should,, it showed me the red widget error you talked about. Also than words would apear but not the entire chat only the word you just spoke. Also the Mic icon didnt reset itself when you finished talking and you had to double click the mic icon to talk again. Idk maby this happend becouse the package versions or libraries have updated and work differently somehow. Anyway after some hours of tuning i finally got it to work properly. So for anyone whose code didn't work try mine : The main.dart : import 'package:avatar_glow/avatar_glow.dart'; import 'package:flutter/material.dart'; import 'package:highlight_text/highlight_text.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; import 'dart:async'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Voice', debugShowCheckedModeBanner: false, theme: ThemeData( primarySwatch: Colors.red, visualDensity: VisualDensity.adaptivePlatformDensity, ), home: SpeechScreen(), ); } } class SpeechScreen extends StatefulWidget { @override _SpeechScreenState createState() => _SpeechScreenState(); } class _SpeechScreenState extends State { final Map _highlights = { 'flutter': HighlightedWord( onTap: () => print('flutter'), textStyle: const TextStyle( color: Colors.blue, fontWeight: FontWeight.bold, ), ), 'voice': HighlightedWord( onTap: () => print('voice'), textStyle: const TextStyle( color: Colors.green, fontWeight: FontWeight.bold, ), ), 'subscribe': HighlightedWord( onTap: () => print('subscribe'), textStyle: const TextStyle( color: Colors.red, fontWeight: FontWeight.bold, ), ), 'like': HighlightedWord( onTap: () => print('like'), textStyle: const TextStyle( color: Colors.blueAccent, fontWeight: FontWeight.bold, ), ), 'comment': HighlightedWord( onTap: () => print('comment'), textStyle: const TextStyle( color: Colors.green, fontWeight: FontWeight.bold, ), ), }; stt.SpeechToText _speech; Timer _timer; bool available; bool _isListening = false; String _text = 'Test'; String _displaytext = 'Hi this is Voice Recognition ,, you said:'; double _confidence = 1.0; @override void initState() { super.initState(); _speech = stt.SpeechToText(); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Confidence: ${(_confidence * 100.0).toStringAsFixed(1)}%'), ), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, floatingActionButton: AvatarGlow( animate: _isListening, glowColor: Theme.of(context).primaryColor, endRadius: 75.0, duration: const Duration(milliseconds: 2000), repeatPauseDuration: const Duration(milliseconds: 100), repeat: true, child: FloatingActionButton( onPressed: _listen, child: Icon(_isListening ? Icons.mic : Icons.mic_none), ), ), body: SingleChildScrollView( reverse: true, child: Container( padding: const EdgeInsets.fromLTRB(30.0, 30.0, 30.0, 150.0), child: TextHighlight( text: _displaytext, words: _highlights, textStyle: const TextStyle( fontSize: 32.0, color: Colors.black, fontWeight: FontWeight.w400, ), ), ), ), ); } void _error() { available = false; _speech.stop(); _timer = new Timer(const Duration(milliseconds: 1000), () { setState(() { _isListening = false; }); }); } void _listen() async { if (!_isListening) { available = await _speech.initialize( onStatus: (val) => print('onStatus: $val'), onError: (val) { _error(); print('onError: $val');}, ); if (available) { setState(() => _isListening = true); _speech.listen( onResult: (val) => setState(() { _text = val.recognizedWords; if (val.hasConfidenceRating && val.confidence > 0) { _confidence = val.confidence; _displaytext += " ${_text}"; } else { setState(() {_isListening = false;}); } }), ); } } else { setState(() {_isListening = false;}); _speech.stop(); } } }
@souravrahman4245
@souravrahman4245 3 года назад
hello .. i copied your code and it is not working properly.after speaking for first time it is not taking my speech.can you help me please
@kidcae
@kidcae 3 года назад
Is there any reason why right before i talk it goes to the red screen error and then quickly fixes itself and shows the text? Also, my emulator is not nearly as fluid as yours but my machine is a monster. Why is this app lagging so bad?
@lilasrinivasreddy
@lilasrinivasreddy 3 года назад
will this work in offline/no internet mode?
@daeeki
@daeeki 3 года назад
Hi Marcus, thank you so much for the awesome contents! I was able to create the app and it works but I'm keep getting the following error in the console "RangeError (index): Invalid value: Valid value range is empty: -1" Any idea why I'm getting this error?
@cerensahin6327
@cerensahin6327 3 года назад
I got that error too. The problem is with the highlighting process. I couldn't solve the problem but instead just got rid of the highlighting process. Now the app works but without a highlighting function.
@ashleyshaw5076
@ashleyshaw5076 3 года назад
For app or websites ?
@nativeworld0
@nativeworld0 3 года назад
can it works on offline too??
@haidangquang867
@haidangquang867 2 года назад
hi everyone. how to config it with other language
@Ainigma
@Ainigma 3 года назад
What is the intro song called?
@garyjanosz9218
@garyjanosz9218 2 года назад
Code runs without errors, but I get a message on my phone that flutter_voice has stopped. I enabled microphone permissions for flutter_voice, but that was not the problem. Does anybody have any ideas? I compared my AndroidManifest.html to your archived file and they are the same, but mine displays the error warnings in the top right corner of the manifest window.
@MrNiceseb
@MrNiceseb 3 года назад
After cloning and trying it out on Simulator, why 50% words are not converted, I deliberately slowed down speech and still not working ? Anyone else had same issue?
@semnick2223
@semnick2223 2 года назад
does anyone know how to fix this error? W/Gralloc3( 8715): mapper 3.x is not supported
@quratulain9835
@quratulain9835 Год назад
how to work flutter_tts pkg in flutter when app is in background or phone is locked?
@clementbabaniyi
@clementbabaniyi 3 года назад
RangeError (index): Invalid value: Valid value range is empty: -1 After copying ur code
@nanusha3030
@nanusha3030 3 года назад
its showing me unhandled exception : missing plugin exception, what should i do to resolve it.
@crazymusicnetwork8844
@crazymusicnetwork8844 3 года назад
can you resolve it?
@MohamedElsayed-co8wv
@MohamedElsayed-co8wv 3 года назад
how search in vsc
@shinjou2
@shinjou2 Год назад
Hi I am new to Flutter. I need help. I downloaded the code and did a flutter put get. I got an error saying the app is using a deprecated version of Android embedding. How to migrate this app to the V2 embedding? Thanks.
@sm-ih4jz
@sm-ih4jz 2 года назад
Is it possible when I want the speech and text in Arabic ?
@asifullah8488
@asifullah8488 Год назад
how to do this using java
@rezwansaki
@rezwansaki 2 года назад
Does it work in offline?
@mctapper7910
@mctapper7910 3 года назад
this real time ?
@user-mz3xq2il8r
@user-mz3xq2il8r Год назад
dose this work in arabic langauge
@wemplatform1951
@wemplatform1951 3 года назад
Can you tell me. WE can put audio msg in Flutter Listener false condition. like if voice no recognition . msg come . you speak wrong or any other language. plz tell me i am waiting for your message.
@md.naymurrahaman7510
@md.naymurrahaman7510 3 года назад
How to Do it Please help me Anyone (This will display a multi-language list in a dropdown list before providing voice. Then I will do voice-over and then convert to that language.)
@samuelyao2637
@samuelyao2637 Год назад
Hiii Marcus how can I enable continuous listening on Android with this speech_to_text on flutter?
@evacareclinic
@evacareclinic 11 месяцев назад
Did you find a solution?
@mazekaty
@mazekaty 2 года назад
support arabic speech ?
@GoldenLionKempo
@GoldenLionKempo 2 года назад
SpeechRecognitionError msg: no-speech in chrome. Any idea what this message means
@akaankshkanchanapalli1171
@akaankshkanchanapalli1171 3 года назад
Hi, I get ListenFailedException in my iOS device in console when i try to listen. Any ideas how to fix it?
@akaankshkanchanapalli1171
@akaankshkanchanapalli1171 3 года назад
@@MarcusNg okay thank you 😊
@jeenusjunanio2400
@jeenusjunanio2400 2 года назад
Hey! will this app work offline?
@clemkonan
@clemkonan 3 года назад
Do I have to be a programmer? I want to be able to use speech to text as I interview clients so that I do not have to worry about my typing speed and I would like to do this with my Android phone.
@jorgemarcelo4708
@jorgemarcelo4708 3 года назад
Hey clem, you can find some apps on the appstore to help you with that! I searched for "voice text" and found a few of useful ones such as "voice notebook". Cheers!
@KienTran-ox4wg
@KienTran-ox4wg 2 года назад
hi, you know, after a brief pause of speaking, the status will change to not listening. Are there any ways to make it listen permanently until clicking the button again?
@evacareclinic
@evacareclinic 11 месяцев назад
Hello, did you find an answer?
@user-fp8mq5em2y
@user-fp8mq5em2y Год назад
speech_to_text is not compatible with Mobile web browsers.
@atiqurrahman6213
@atiqurrahman6213 3 года назад
Hey Marcus I got this error, onError: SpeechRecognitionError msg: error_network, permanent: true I tried to find the issue but could'nt , can you help me here ? Thank you
@mehmetcancesur3326
@mehmetcancesur3326 3 года назад
i am getting the same error , did you solve ?
@shubham5578
@shubham5578 3 года назад
I am unable to import speech_to_text package it shows error like this: pub get failed (65; ╵) exit code 65
@aqifmontana9886
@aqifmontana9886 3 года назад
It is so becouse you pubspec.yaml is not well formated : Copy paste this and replace.. Than hit pub get dependencies: flutter: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.3 speech_to_text: ^2.3.0 highlight_text: ^0.7.2 avatar_glow: ^1.2.0
@NoOne-uz4vs
@NoOne-uz4vs 3 года назад
Does it support other languages or just english?
@NoOne-uz4vs
@NoOne-uz4vs 3 года назад
@@MarcusNg Thank you!!
Далее
Top 30 Flutter Tips and Tricks
6:50
Просмотров 538 тыс.
Flutter Speech to Text - It's so Easy #flutter
10:03
Просмотров 1,2 тыс.
Complex Animations in Flutter using Rive | Flare
15:44
Просмотров 224 тыс.
Flutter In App Rating Prompt Tutorial
6:26
Просмотров 27 тыс.
Flutter Spotify Clone Desktop/Web UI | Apps From Scratch
1:00:39