Accessing music library and playlists on iPhone - 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.

Related

Pulling songs from iOS music library into an App?

I am developing an HTML5 mobile application that should allow users to upload music directly into the application.
The music should be able to be pulled from:
Youtube (opens YouTube interface to insert YouTube link)
SoundCloud (opens SoundCloud profile to insert link/mp3)
Upload from Phone (open iOS music library within phone to select song to upload)
Question:
I want to allow the users to pick a song from their iOS native music library and upload it directly into the app as an mp3.
I've read that a possible solution is to copy the raw song data to the App Storage Directory via the AVAssetReader.
Any other good solutions?
Im going to assume then this is a hybrid so the app will be part native. Yes, you can get the raw song data. You can get it in a variety of different file types. You can do whatever you want to it. You want to somehow send it across to a server, and then load it back into your app on the html5 web interface? Sounds crazy but you might be able to do that. You also might have legal issues and get denied from the app store.

Is it possible to purchase a song on iTunes in app to be recorded over?

I'm a new developer working on an app that allows users to record vocals over a track. I have some tracks that I am selling on iTunes and I would like for users to be able to purchase the a tracks from inside the app and load them to be recorded over.
So what I want is for a user to select a track listing from a table, purchase the track in-app, and be able to press button that will switch views to an audio recorder that loads that track to be recorded over. I've been scouring the documentation and I'm struggling to figure out whether this is even possible.
Does anyone know if this is possible, and can anyone point me in the right direction as to where to begin piecing the code together?
Thank you!
Short answer: Yes it's possible to do what you're trying to do
Long answer: It's possible to access the audio data from any song in the music library using an AVAssetReader (more info here How would you connect an iPod library asset to an Audio Queue Service and process with an Audio Unit? and in a bunch of other SO questions)
You'll probably need to copy the song file into the app's documents directory first to work with it. Then you'll probably need to use Audio Units to mix the microphone input with the audio, but that's a whole other topic that I'm not particularly familiar with so you'll have to search SO for more info on that, there's plenty of related questions.
As for purchasing the song, the easiest way would probably be to just link to the song in the iTunes store and have them buy it there, I believe you can even be an iTunes affiliate so you can possibly make additional money on the purchases that way. Once they have the song, it will be in their library and you can use the AVAssetReader to get it.
You could have the songs listed in a table, and in the didSelectRowAtIndexPath: delegate method you could open the link to the iTunes store for that particular song.
Hope that helps.

Access iPhone User Songs and Videos?

I was wondering if I can access user's songs and videos in iPhone, part of that access if I can save them or modify them? hopefully not a Jailbroken iPhones
I am greatly appreciated.
Yes, you can. I can't speak for video, because I've only done it for audio, but you can definitely get audio data. These links should get you started. Note: I am as yet unsure if this works with tracks that use any kind of iTunes-related DRM.
First of all, this blog post talks you through the method of accessing the data. Note the reliance on iOS 4.1 or above.
This SO question/answer explains how to get at the raw pcm data, should you want to do more than just save it out.
You can allow the user to pick songs using the MPMediaPickerController class. I think you can save the selected item to your app's sandbox directory.
You can read up on this a bit more with this SO question.

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

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?

Making ringtone of music files on Iphone

Is it possible to edit music files stored on iphone in app and create ringtone from them?
Any help would be appreciated.
If I understand correctly, you want to extract the music from an existing iPhone app, and then turn that music from the app into a ring tone?
The short answer is no, not if you keep your iDevice up to date and within apple's licensed operating paradigm.
The longer answer is maybe. If you jailbreak the device, you may be able to hack access to the application and extract the desired data.
If I don't understand correctly, and you're just looking to change any old mp3 into an iPhone ringtone, try googling for iPhone ringtone hacks. Of course your mileage may vary but google is again your friend.
Sorry to not provide any code. This question didn't seem to warrant it.
No, for a number of reasons. The SDK doesn't give you access to the actual file data from the music library (just an object that will play music back for you), and while you can probably export an M4A file, with an "m4r" extension that iTunes will recognize as a ringtone, you'll have to get the user to take the file off their device and import it into iTunes manually for it to be usable as an actual ringtone on their phone.