audioplayers icon indicating copy to clipboard operation
audioplayers copied to clipboard

Error when working with text_to_speech package

Open luomo-pro opened this issue 2 years ago • 1 comments

When I use text_to_speech to read a text aloud while using the audioPlays package to play a short sound effect, I get the following error message: "Error configuring audio session: Error Domain=NSOSStatusErrorDomain Code=560030580 "(null)"" Sometimes it will terminate the speech of text_to_speech. If I don't call audioPlays to play the sound effects, then text_to_speech can read the text aloud normally. I don't know if this error is caused by text_to_speech or audioPlays, can there be a solution? This is the text_to_speech package: https://pub.dev/packages/text_to_speech

luomo-pro avatar Mar 12 '22 12:03 luomo-pro

Im facing same issue when using this package with text to speech. I have determined that problem is in SwiftAudioPlayersPlugin

func maybeDeactivateAudioSession() { let hasPlaying = players.values.contains { player in player.isPlaying } let session = AVAudioSession.sharedInstance() if !hasPlaying { #if os(iOS) configureAudioSession(active: false) #endif } }

Here checking just if some players is playing audio, but if some other clients are recording right now, the session will stop independently, that will cause error because session that has running IO tried to be stoped

Puyre avatar Jun 03 '22 07:06 Puyre