ios - AVAudioEngine stops device's background audio -


i using avaudioengine object, has many avaudioplayernodes attached it. audio works fine, except stops audio iphone playing in background (i. e. itunes or music app).

when app opened, stops other background audio. there way allow background audio continue play? when app using avaudioplayernodes play audio itself?

music app has it's own audiosession, makes audio engine stops, had problem too, please restart after music app.

func stepb_startengine(){     if  engine.running == false {         { try engine.start() }         catch let error {             print(error)         }     } } 

setup audiosettion also:

func setupaudiosession(){     do{         try avaudiosession.sharedinstance().setcategory(avaudiosessioncategoryambient, withoptions: avaudiosessioncategoryoptions.mixwithothers)         try avaudiosession.sharedinstance().setactive(true, withoptions: avaudiosessionsetactiveoptions.notifyothersondeactivation)     } catch let error {         print(error)     } } 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -