flutter_soloud
flutter_soloud copied to clipboard
fix: Unable to play audio when used with `speech_to_text` on iOS
Description
Hello, I tried to use SoLoud with speech_to_text.
Audio plays well when STT listening, but if once STT listening is stopped or cancelled, the audio can't play anymore.
I made a simple example based on buffer_stream/generate at forked branch, stt_unable_example. (Commit Diff)
Steps To Reproduce
- Generate PCM data - I left bouncing UI only.
- Click Play bouncing - Audio plays well (looping mode)
- Click Pause switch - Audio pause/unpause well
- Start STT - Audio pause a little, but it's ok for my situation
- Say something - STT module listens well, screen shows speech recognition (Hello on screenshot)
- ❗Stop STT - Audio stops suddenly.
- Can't play anymore
Expected Behavior
When Stop STT on 6, I expect playing Audio doesn't stop. Even if it stops, I expect I can resume/play the audio again.
Screenshots
https://github.com/user-attachments/assets/f0a808b4-0d4f-4fbe-b0eb-c1269ad18bf7
Additional Context
Tested on iPhone 13 mini, iOS Versions=18.4.1