bluefireteam / audioplayers

A Flutter package to play multiple audio files simultaneously (Android/iOS/web/Linux/Windows/macOS)
https://pub.dartlang.org/packages/audioplayers
MIT License
2.01k stars 844 forks source link

Error when playing many sounds shortly after each other #1083

Open maitycyrus opened 2 years ago

maitycyrus commented 2 years ago

22-03-09 23:45:30.878618+0100 Runner[13316:3832591] [default] AudioSessionCopyProperty_Priv posting message to kill mediaserverd (13340) 2022-03-09 23:45:30.911209+0100 Runner[13316:3832591] [avas] AVAudioSessionUtilities.h:114 AudioSessionGetProperty ('chov') failed with error: 'what' 2022-03-09 23:45:30.911307+0100 Runner[13316:3832591] [avas] AVAudioSessionUtilities.h:138 AudioSessionGetProperty ('chov') failed with error: 'what'

gokadi commented 2 years ago

I'm facing the same error. At some moment my app becomes unresponsible for touches for about 10-20 seconds (although other processes are fine, animation going etc.)

[default] AudioSessionSetProperty_Priv posting message to kill mediaserverd (28088)
"Error configuring audio session: Error Domain=NSOSStatusErrorDomain Code=2003329396 \"(null)\""
"Error configuring audio session: Error Domain=NSOSStatusErrorDomain Code=2003329396 \"(null)\""
"iOS => call startHeadlessService, playerId 9f3f5a01-bed5-4b85-8702-3fea1ea5ef26"
"calling start headless service (\n    \"-6035574777829228503\"\n)"
"iOS => call play, playerId 9f3f5a01-bed5-4b85-8702-3fea1ea5ef26"
"Error configuring audio session: Error Domain=NSOSStatusErrorDomain Code=1836282486 \"(null)\""
"Error configuring audio session: Error Domain=NSOSStatusErrorDomain Code=1836282486 \"(null)\""
"iOS => call startHeadlessService, playerId 806be23f-76e4-432e-8941-a1d6523e30b9"
"calling start headless service (\n    \"-6035574777829228503\"\n)"
"iOS => call play, playerId 806be23f-76e4-432e-8941-a1d6523e30b9"
"Error configuring audio session: Error Domain=NSOSStatusErrorDomain Code=1836282486 \"(null)\""
"Error configuring audio session: Error Domain=NSOSStatusErrorDomain Code=1836282486 \"(null)\""
"iOS => call startHeadlessService, playerId 903d4759-eec6-4205-8d87-aa22914dbc7b"
"calling start headless service (\n    \"-6035574777829228503\"\n)"
"iOS => call play, playerId 903d4759-eec6-4205-8d87-aa22914dbc7b"

How I use it:

if (_player == null || _player.state != PlayerState.PLAYING) {
    audioCache.play(file, volume: volume, mode: PlayerMode.LOW_LATENCY);
}

and that's it. App is a shooter game, so I wanted to make sound controller with several priority levels, but I get this error even when only 1 priority is turned on (for it only 1 sound can be played simultaneously by design)

gokadi commented 2 years ago

Probably duplicate of https://github.com/bluefireteam/audioplayers/issues/1147

Gustl22 commented 1 year ago

Which version? You should use version > 1.x.x. Can you retest? But you @gokadi use Android and the issue has to do with ios as it's stating the AVAudioSessionUtilities Or sth like #1027 Marking as stale, as it seems to be from before 1.x.x