Allow User's Music to Play when Application is Running - Cocos2d - iphone

I'm not completely sure if this is used with Cocos2d, but I would like to know how I could let the user play their own music from their playlists or if my application could randomly choose a song from their playlist.
Is that possible?
Thanks

You can check if another music is playing using CDAudioManager singleton. Use the function isOtherAudioPlaying. http://www.cocos2d-iphone.org/api-ref/0.99.5/interface_c_d_audio_manager.html#ab664b34e99f6f3e2158f2df910cf3a95

Related

is it possible to play AppleMusics inside my app? If yes then how can i play this?

I'm beginner to iOS development. I want to play AppleMusic inside my app. please let me know is it possible or not?
If it is possible then please suggest me how can i play this.
I found this Link but i don't know wether it play music with iPhone default player or AVPlayer?
It is possible with music kit. Check out https://developer.apple.com/musickit/, but the users will need to have an apple music account.

How to allow ipod music to play while my app is running?

I'm using SimpleAudioEngine to play my sounds and I was wondering if there is anyway to check if iPod music is playing when the app is launched. If so, I want it to continue playing. I'm starting to think it may be called the simple engine for a reason as it doesn't allow features like this, where AVAudioEngine does...
Thanks :)
You should check out the official Audio Session Programming Guide and make sure that you are setting the correct session category. You will want to pick the category that allows your audio to mix with the iPod audio.

iPhone (iOS4): is it possible to play music/sound during an active call?

I want to allow user to switch to my app during a phone call and play some sound that the second person will hear.
I see here that it was possible even before iOS4 and here that no one knows how to do it.
I will really appreciate if someone will spread some light on this issue.
Thank you.
If you would like to play a song and after launch a phone call, any iPhone OS will stop your song, just beacause phone call has privilege over audio playback.
What you can do is play a song after the call has started, but in this case you can only use speakers.
I've tried the second, and with great audio tracks and some simple advises, you can reach the desired effect.
You could achieve it using Twilio API

Listening to the iPhone mic with SCListener and playing music at the same time: how?

I am using Stephen Celis' SCListener class (for iPhone) to "listen" from the microphone, but I also need to be playing music at the same time using the MediaPlayer framework. However, when I start listening with SCListener, the music fades out and stops. I have set the kAudioSessionCategory_PlayAndRecord property on the audio session in SCListener, which should allow me to play audio and record audio at the same time, but as far as I can tell it has no effect. I'm confused, because according to other developers' results, this works just fine, but not for me. I'm thinking maybe the kAudioSessionCategory_PlayAndRecord property allows you to play sound and record if you're using the AVAudioPlayer framework or something to play the sound, but maybe not the MediaPlayer framework? This would be a problem for me because I need to play music from the user's iPod library, which, as far as I know is only possible to do using the MediaPlayer framework.
Does anyone know how I can get around this problem? Thanks in advance!
Unfortunately I still haven't found a solution to this problem. But after lots of testing, I'm pretty sure it's not possible to record sound while playing music with the MediaPlayer API, although if you use a different API to play sound, i.e. AVAudioPlayer, it usually does work. MediaPlayer is the only API that can play iPod music though.

iPhone: how to let the music play for an application using OpenAL?

I'm writing an iPhone app that uses OpenAL. When the application starts, the music playing in background stops.
The music actually stops playing when I initialize the OpenAL library.
My question is, is there any way to use OpenAL while letting the background music play?
You need to change the Audio Session Category to kAudioSessionCategory_AmbientSound instead of kAudioSessionCategory_SoloAmbientSound which is the default.
You can find out more about it in the Audio Session Programming Guide. Here's a link to the relevant part of the documentation.