My app uses Audio Unit to play mp3 files in IOS, but when the screen off, the sound stopped -


my app uses audiounit play mp3 files, totally used remoteio, newtimepitch, auconverter , multichannelmixer 4 audiounits.

my app play when screen locked, can not play while screen off!

even more strangely, issue happens in iphone4s(v6.1.3), works fine in iphone5(v6.1.4)!

here audio-unit setting code:

// connect audio unit: converter -> timepitch -> output osexcute( augraphconnectnodeinput(processinggraph, converternode, 0, timepitchnode, 0) ); osexcute( augraphconnectnodeinput(processinggraph, timepitchnode, 0, mixernode, 0) ); osexcute( augraphconnectnodeinput(processinggraph, mixernode, 0, eqnode, 0) ); osexcute( augraphconnectnodeinput(processinggraph, eqnode, 0, outputnode, 0) );  // try fix no sound issue, not work uint32 maximumframesperslice = 4096;     osexcute( audiounitsetproperty(mixerunit, kaudiounitproperty_maximumframesperslice, kaudiounitscope_global, 0, &maximumframesperslice, sizeof (maximumframesperslice))); 

i have fixed issue. solution is: set kaudiounitproperty_maximumframesperslice 4096 every audiounit except remoteio unit.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -