dimitris-c / AudioStreaming

An AudioPlayer/Streaming library for iOS written in Swift using AVAudioEngine.
MIT License
266 stars 56 forks source link

audioPlayerDidFinishPlaying stopReason is none not eof #53

Closed peterpaulis closed 8 months ago

peterpaulis commented 1 year ago

After the playback of the remote file ends, in

    func audioPlayerDidFinishPlaying(player: AudioStreaming.AudioPlayer,
                                     entryId: AudioStreaming.AudioEntryId,
                                     stopReason: AudioStreaming.AudioPlayerStopReason,
                                     progress: Double,
                                     duration: Double)

i get

stopReason == .none

not .eof

i drilled down why this happens and its because the atomic writing block for stopReason is executed after the delegate callback, despite the atomic operation is requested earlier

iOS16

dimitris-c commented 8 months ago

@peterpaulis know this is a long time but this should now be fixed