How do i allow a user to pick a song from their iPod library? - iphone

For my app, an alarm, i'd like the user to be able to pick a song to play from their iPod library. How would i go about implementing this?

Do not know the details, but have you read the iPod Library Access Programming Guide?

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.

Accessing music library and playlists on iPhone

On iPhone, I'd like to be able to allow the user to select a song from their iTunes library.
Also, I was wondering how an app can access the specific playlist that song resides in (and how my app can access other songs in that playlist).
Since you've asked a fairly open question, all I can suggest is have a look at the iPod Library Access Programming Guide to get started and then come back with a more detailed question after you've tried some thing.

iPhone iOS5 what are my options for playing audio I do not have bundled in?

I currently have 3 ways to play audio within my app:
Using AudioServicesPlaySystemSound for vibration and simple
sounds
Using Audio Toolbox for bundled files (3rd party class)
Using AudioServices with AudioFX
What I'm currently investigating is, if I can play other kinds of audio that are already present on the iPhone. I would like to reduce my app's download size, as well as offer more flexibility in terms of the kind of sound that the user can play.
Can I play from within my app:
Audio recordings from the Voice Memos app, or do I have to
create my own recordings? Items from an iPod playlist or Music app?
Items from youtube by pre-loading them, or will I have to stream them every time?
Existing ringtone for the phone?
I am a complete beginner when it comes down to playing audio on an iPhone and am already using two 3rd party classes for audio tasks.
Is there an easy way to accomplish some of the tasks listed above?
1) Audio recordings from the Voice Memos app
It's been asked before and I don't believe it's possible from your app sandbox.
iPhone: Access voice memos programmatically
2) Items from an iPod playlist or Music app
There's an API for that, the iPod Access Library:
http://developer.apple.com/library/ios/#documentation/Audio/Conceptual/iPodLibraryAccess_Guide/Introduction/Introduction.html
3) Items from youtube
Should be possible, using a UIWebView.
http://iphoneincubator.com/blog/audio-video/how-to-play-youtube-videos-within-an-application
4) Existing ringtone for the phone
No, you can't access the current ringtone programatically.
How can I programmatically determine the default ringtone on an iPhone?
You can download sound files on first start (not in your didFinishLaunchingWithOptions method or your app will likely be killed) and save them locally, then you can just play them when needed. You can play files in their iTunes library, but won't know what they have in the library.
To play from their library, this is a handy example:
http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-music-library-access/
You can also record user input from your app with AVAudioRecorder, save that and then play it whenever.

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.

Stream a song on an iphoe to another iphone?

Is it possible to write an iphone app that allows a user to pick a song (located on their iphone) and have it play out on an another iphone based on a client-server type relationship over a wifi connection?
Thanks for your help,
Lee
You don't ever get access to song data from the iPod library on the phone. All you can do is get the phone to play the audio. Apple won't allow this as it would violate copyright.