ixsans / text_to_speech

A Flutter plugin provides TTS (Text-To-Speech) Service
BSD 3-Clause "New" or "Revised" License
16 stars 22 forks source link

Change button icon when stopped #2

Open ivanacu007 opened 2 years ago

ivanacu007 commented 2 years ago

Is there any way to detect when the speech ends?

abayomiAkanji commented 2 years ago

You should be able to detect it after the await operator is completed.

That is:

await TextToSpeech().speak(text);
// Operations here should be executed after the speech ends.
abayomiAkanji commented 2 years ago

@tascienes Any error log when testing on iOS?

abayomiAkanji commented 2 years ago

@tascienes Any error log when testing on iOS?

console is empty. there isn't error log..

print('start'); await textToSpeech.speak(text); print('finish');

It outputs only 'Start'

@tascienes does it print finish on Android? What's the length of the text?

tascienes commented 2 years ago

@abayomiAkanji Android gives finish as output. But it gives before the end of the reading. This is not a problem for me. Text 'test message'

tascienes commented 2 years ago

Now I tried the example in the documentation. It didn't work either. When I remove await everything is fine but this is not correct :)

abayomiAkanji commented 2 years ago

@tascienes Well, in the meantime, you might want to explore this other package https://pub.dev/packages/flutter_tts