syedhali / EZAudio

An iOS and macOS audio visualization framework built upon Core Audio useful for anyone doing real-time, low-latency audio processing and visualizations.
Other
4.94k stars 821 forks source link

EZAudio crashes when EZAudio file is written to #300

Open andrewJermaine-ios opened 8 years ago

andrewJermaine-ios commented 8 years ago

Hi all, I'm using a header file to bridge EZAudio. I want to set my EZAudioFile variable to a NSURL. Ive breakpointed the function that does so, and it dies with no error whatsoever once I try to step over the line. I call the function in viewDidLoad, it jumps to it, steps through, then crashes out of the app at 'audioFile = EZAudioFile(URL: filePath)'. Here's the function: `func preparePlot() { audioPlot!.backgroundColor = UIColor.blackColor() audioPlot!.color = UIColor.whiteColor()

    player = EZAudioPlayer(delegate: self)

    let filePath = NSURL(string: NSBundle.mainBundle().pathForResource("track_33", ofType: "mp3")!)

    //it crashes when I step over the line below
    audioFile = EZAudioFile(URL: filePath)

    print(audioFile.getWaveformData())

    player.playAudioFile(audioFile)

    player = EZAudioPlayer(URL: filePath)
    print(player)

    if player.isPlaying {

        print("You shouldn't hit this point in the code")

    } else {

        audioPlot!.plotType = EZPlotType.Buffer
        audioPlot?.shouldFill = false
        audioPlot?.shouldMirror = false

        player.play()
        print("aim was played")

    }

}`

Maybe I need to return something? Any suggestions are much appreciated. Thanks!