flutter-sound-stream icon indicating copy to clipboard operation
flutter-sound-stream copied to clipboard

Recording stream stops working on iOS if audioplayers plugin used to play an audio file

Open sveinbjornt opened this issue 4 years ago • 11 comments

I am using the sound_stream package to do microphone recording and using the audioplayers Flutter package (https://pub.dev/packages/audioplayers) to do audio playback. However, after I play a sound, the sound_stream recording stops working. This seems to only happen on iOS.

sveinbjornt avatar Dec 15 '20 23:12 sveinbjornt

Yes. I'm also facing the same issue.

IssacPrecious avatar Jan 05 '21 05:01 IssacPrecious

@IssacPrecious I ended up using flutter_sound instead, for both recording and playback.

sveinbjornt avatar Jan 05 '21 18:01 sveinbjornt

you should add library and a small changes into the library of audio player plugin it can easily resolve this issue

Toseefsaim avatar Sep 06 '21 19:09 Toseefsaim

By default iOS and macOS forbid loading from non-https url. To cancel this restriction on iOS or macOS you must edit your .plist and add:

NSAppTransportSecurity NSAllowsArbitraryLoads

change into manifest file

Toseefsaim avatar Sep 06 '21 19:09 Toseefsaim

By default iOS and macOS forbid loading from non-https url. To cancel this restriction on iOS or macOS you must edit your .plist and add:

NSAppTransportSecurity NSAllowsArbitraryLoads

change into manifest file

Toseefsaim avatar Sep 06 '21 19:09 Toseefsaim

How you fixed it without touching another package? I'm using just_audio.

t-kietzmann avatar Sep 13 '21 18:09 t-kietzmann

Hello did anyone get the solution because i am also facing the same issue. Thank you.

NikhilKukreja26 avatar Sep 24 '21 12:09 NikhilKukreja26

Some news? Or did someone find a lib which is working on iOS?

t-kietzmann avatar Jan 06 '22 21:01 t-kietzmann

Some news? Or did someone find a lib which is working on iOS?

yes using soundpool package for audio playback works.

Teajayy007 avatar Feb 07 '22 14:02 Teajayy007

Hello, I have a similar issue. After I play a file using just_audio (I have made sure I stop , cancel and dispose after playback), I can't get sound stream to pick up the mic input. If I do not play the file before and use only sound stream to record, it works as intended. I am using the soundstream recorder. Any reasons why or any tweak/hack that could work. I really don't want to use another streaming package but can change my playback package if necessary

RishiKar avatar Feb 25 '22 16:02 RishiKar

Solution by @larpoux here: https://github.com/Canardoux/flutter_sound/issues/855

It is for his package flutter_sound, however it also indeed resolves this issue for sound_stream also.

Please consider buying him a coffee (or more) for his hard work, he spent several days resolving the issue with a detailed explanation :)

https://www.buymeacoffee.com/larpoux

quickratio avatar Mar 14 '22 03:03 quickratio