flutter_soloud icon indicating copy to clipboard operation
flutter_soloud copied to clipboard

fix: Unable to play audio when used with `speech_to_text` on iOS

Open bom-bakbang opened this issue 6 months ago • 3 comments

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

  1. Generate PCM data - I left bouncing UI only.
  2. Click Play bouncing - Audio plays well (looping mode)
  3. Click Pause switch - Audio pause/unpause well
  4. Start STT - Audio pause a little, but it's ok for my situation
  5. Say something - STT module listens well, screen shows speech recognition (Hello on screenshot)
  6. ❗Stop STT - Audio stops suddenly.
  7. 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

bom-bakbang avatar Apr 29 '25 09:04 bom-bakbang