Closed emrecodeway closed 3 months ago
I want to make sure that we're talking about the same thing. There is no startListening
or startListeningiOS
method in the STT package. The STT method is listen
There is a startListening
method in the example so perhaps you've called your methods the same?
For WebRTC, and other sound packages that use sound, there's no way to share the underlying sound resources of the OS, at least none that I've found. So you have to shutdown the WebRTC session while doing speech recognition then start it back up again afterwards.
Thank you for your response and clarification.
I would like to confirm that startListening and startListeningiOS are indeed custom methods in my implementation, inspired by the example code provided in the package documentation. These methods function as expected.
However, the core issue I'm encountering is with the flutter_webrtc audio stream. Specifically, the audio gets muted after invoking the listen method from the package. This muting persists even after I execute the stop and cancel methods of the speech recognition package, before forwarding the recognized speech results to the streaming service.
On your suggestion, I will attempt to close the WebRTC session and then start a new one post-STT interaction, and I will observe that this approach does indeed resolve the audio issue. It seems like managing the WebRTC session state around the STT interactions is a viable workaround.
Thank you again for your assistance. It has been instrumental in helping me identify a solution.
Description
I am developing a Flutter application where I use both the
speech_to_text
package for speech recognition andflutter_webrtc
for video streaming. The application functions correctly with the WebRTC video streaming, including audio, until speech recognition is initiated. After using thestartListening
(andstartListeningiOS
for iOS) method from thespeech_to_text
package, the speech is successfully recognized and processed. However, once the STT session is stopped (usingstopListeningiOS
), the audio from the WebRTC stream is turned off, and I'm unable to re-enable it.Steps to Reproduce
startListening
/startListeningiOS
.stopListeningiOS
.Expected Behavior
After the STT session is stopped, the audio from the WebRTC stream should continue to play as normal.
Actual Behavior
The audio from the WebRTC stream is turned off after the STT session is completed and does not resume.
Additional Information
speech_to_text
package version: 6.5.1flutter_webrtc
package version: 0.9.47It seems like the STT functionality might be interfering with the WebRTC audio stream, and there doesn't appear to be a re-initialization or reactivation of the audio stream after the STT session is completed. I am looking for guidance on how to manage the WebRTC audio stream state in conjunction with the STT functionalities or if there's a known issue/workaround for this scenario.
Any assistance or insight into this issue would be greatly appreciated.