Play audio in background - iphone

I want my app will play music when she is in the background too,
there is any way to do it? i try to use apple documentation but it didn't work.
it is possible that because i am now using the avplayer i cant play audio in background?
i play the music with
ExtAudioFileSeek(mExtAFRef, finalFrames);

I think playing audio in background is possible only for streaming audio. For normal audio we can only play when screen is locked.

You should look at documentation of using background tasks like:
http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html
and specially the:
http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH5-SW14

Related

Flutter Just Audio background Package

When play any song then close the app with background playing after that start the app then recent playing song activity show, this good but i wanna that when start the app then app reload, how's possible?
Just audio dont work in background use this just audio background or audio_service is too much advanced or audio player ;
dont forget to add background mode in Xcode :
Hope it work for you ; Good luck

Use camera in react native app with background audio playing? (Like a song from music app)

When recording a video or opening the camera with react native background audio is paused.
Is there a specific or recommended way to allow background audio to play when the camera is open?
I am using react-native-camera and have used react-native-image-picker previously but they do not have anything in their documentation related.
After doing some looking around, in swift there is AVAudioSession which could potentially be used on the native side?
I would love some recommendations and guidance to resolve this!

Play video's audio track when enter background?

I'm using mpmovieplayer to play video on ios 4, and I want to keep the audio playing when my app enter background, but it doesn't work. I thing it's because video player use GPU to render video on screen and this is not allowed by apple when app enter background.
So, is there any way to do that? There are some apps have this feature, and they seems just use the mpmovieplayer, is it work by detach the video layer of mpmovieplayer?
Thanks for your answer!
You'll need to have separate audio file and video file for this. Play both when you need to play video and just the audio when app gets into background.

Can a iPhone voice Recorder App always run in Background recording the Sounds and Play them?

Can a App record the Voice in the surroundings even when it runs in the background and play the recorded audio? Is it possible?
Multitasking doesn't allow audio recording to be in the background, so no.

Objective-C - Adding sound on iPhone

I'm making a sound for the iPhone and I'm interested in adding background music and background sounds.
Is CoreAudio right for the job?
And if so, how do I use it?
If you're just playing background music and doesn't need advanced controls, try AVAudioPlayer.
For sound effects, use AudioServicesPlaySystemSound.