mihai8804858 / swift-chunked-audio-player

Simple audio player for sync / async chunked audio streams
MIT License
28 stars 6 forks source link

App Crashing #5

Closed dustin-kl closed 4 months ago

dustin-kl commented 4 months ago

My app occasionally crashes when using the audio player.

It throws an "EXC_BAD_ACCESS" in the following function.

func parseData(_ data: Data) {
        guard let audioStreamID = audioStreamID else {
            print("audioStreamID is nil")
            return
        }

        guard !data.isEmpty else {
            print("Data is empty")
            return
        }

        data.withUnsafeBytes { pointer in
            guard let baseAddress = pointer.baseAddress else { return }
            AudioFileStreamParseBytes(audioStreamID, UInt32(data.count), baseAddress, [])
        }
    }

More specifically it happens in this line

AudioFileStreamParseBytes(audioStreamID, UInt32(data.count), baseAddress, [])

mihai8804858 commented 4 months ago

Fixed in 1.0.2

dustin-kl commented 4 months ago

Amazing!