Open matiasf9 opened 9 years ago
+1
I fixed replacing all the lines related to AVAudioSession like:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; [[AVAudioSession sharedInstance] setActive:YES error:nil]; [[AVAudioSession sharedInstance] setActive:NO error:nil];
By a line like this: [[MyPlayer sharedInstance] setUpAudioSession];
And I manage the AudioSession correctly there by myself.
@matiasf9 i am also facing the same issue. could you tell me what should i do to solve this?
in your comment, what will do in "setUpAudioSession"?
@matiasf9 same issue.. can you please post your fix?
+1
@muhku any news?
solved by:
let configuration = FSStreamConfiguration()
configuration.automaticAudioSessionHandlingEnabled = false
audioPlayerMeditation = FSAudioStream(configuration: configuration)
audioPlayerMeditation?.url = url as NSURL
When I stop a FSAudioStream with a stream url loaded ( [self.streamer stop] ) and then start immediately an AVAudioPlayer with a local file ( self.audioPlayer = [[AVAudioPlayer alloc] initWithData:soundData error:&error], [self.audioPlayer play]; ), the audioPlayer´s sound is stopped and the device throw me a warning ([0x384aa9dc] AVAudioSession.mm:646: -[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.)
This does not happen in the simulators, only in devices. In simulator, the code works perfect.