bartolsthoorn / NVDSP

iOS/OSX DSP for audio (with Novocaine)
MIT License
413 stars 80 forks source link

Some Interruption when the app go to background #31

Closed baderbenzribia closed 8 years ago

baderbenzribia commented 8 years ago

Hello, I'm using NVDSP with my application and I have a little problem with it when the app go to background, unlike your exemple, my application keep the audio playing when the app go to background, and occasionally the audio played in an interrupted manner. I see the same problem when I run your exemple, The audio Is automatically played, I tap the home button and Just before the app go to background the audio play with interruption. Any Idea why this is happening please ?

bartolsthoorn commented 8 years ago

I haven't experienced this myself, but perhaps you can check if you can use one of the available events/hooks that iOS provides when an app goes to the background. (maybe you should manually stop the audio playback when the app closes)

baderbenzribia commented 8 years ago

What I want is to keep the audio playing when the app go to background. Thanks.

bartolsthoorn commented 8 years ago

What exactly do you mean with interruption?

Also, have you checked that the project settings allow for audio playback in the background? See the first two points here: stackoverflow.com/a/20181026/335412

If you are experiencing noise because the CPU can't keep up with all the processing you are probably doing too much work in setOutputBlock. By eliminating things from that loop that only need to be executed once (such as allocating the filters), you can avoid that.

Do you also experience trouble without NVDSP (is this maybe a novocaine issue)?