csdcorp / speech_to_text

A Flutter plugin that exposes device specific text to speech recognition capability.
BSD 3-Clause "New" or "Revised" License
348 stars 217 forks source link

when speech_to_text library is active at that time flutter_tts library is inactive in IOS vice versa #461

Closed Sagar710-CS closed 4 months ago

Sagar710-CS commented 5 months ago

when speech_to_text library is active at that time flutter_tts library is inactive in IOS vice versa

-platform Iphone.

sowens-csd commented 5 months ago

Is this a problem for you or are you trying to help other people with some information?

Yes, both STT and TTS use the underlying audio system of the device so you can't have them active at the same time. They do work together just fine as long as you activate and deactivate them as needed. Or at least they did when I last tried it. If you are having an issue please let me know.

Sagar710-CS commented 5 months ago

This is a problem in my own app.

The issue is that once I set speechtotext .stop() after that text to speech also stops working. I want to implement a translate function in which user can input text with speech. then I can translate the user input to another language and then the user can use text to speech function on the translated text to know how the word is pronounced.

sowens-csd commented 5 months ago

This should work. Try waiting for the onStatus callback to signal notListening before using TTS. Similarly wait for TTS to be done speaking before starting a new listen session with STT.

sowens-csd commented 5 months ago

Is that working for you?