Accessing media library in iOS - iphone

I want to access songs from media library and then want to cut a part of that song.
I have written function to cut a song from bundle and it is working fine.
Now I want to allow user to select song from library, how can I do that?

Just like how you access all other media in ios- using AssetsLibrary, more about this here:
http://developer.apple.com/library/ios/#documentation/Miscellaneous/Conceptual/iPhoneOSTechOverview/MediaLayer/MediaLayer.html
Be aware that all the media is read only and you can manipulate only a copy of the songs and not the original.

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.

Play a video from video gallery in iPhone app

I am developing an iPhone app, in which I have to play multiple videos like "Top rated", "Most played","Favorites" etc.. Each category may have around 20 videos. So having around 100 videos inside resources folder increases the app size. So what I am trying to do is, first saving all the videos locally within the device and selecting the respective videos from the app whenever these videos needs to be played. So is it possible to do so?
Or have to have all the videos inside resources folder?
Thanks in advance.
yes, this is very well possible. you can store your videos in the device before instead of the resources folder and use the ALAssetsLibrary to get access to your videos stored in the photo library.
refer this on how to use the ALAssetsLibrary display image from URL retrieved from ALAsset in iPhone

how can i store song from ipod to document directory of my application

i can be able to fetch the ipod library and also able to play that file on one page but can not be able to store the path of selected song and play it to another page. so can any one tell me how can i copy the selected song to document directory of my application and can use it to another location
thanks
if you have the song in your ipod and want to extract the music out, you'll need some special software to do this.
try http://www.itransferstudio.com/ it's a free download

iPhone Music Library Access

I would like to develop an application for iPhone that classifies the user's music according to user-defined genres. The application should be able to have access to iPhone's Music Library and work on the files, this is, fetching an mp3 file, apply some DSP ( like MFCC coefficients ) and then save the results on the file itself.
Is it possible to obtain a song as a file and work on it?
No. You have access to the music library database and can launch a music player to play a certain song but under the SDK you have neither access to the song files themselves nor to the actual PCM data of the music.
Also, access to the music library database on the device is strictly read-only, so you can't modify genres etc. if that was your plan.
I know this is not the answer you are looking for, but given that you can't access the music data from the iPhone, you might consider having a desktop app that accesses the user's music on their Mac/PC, and encodes something into the genre of the music there. Then you could write a music player app for the iPhone that can understand your genre descriptor and function accordingly. You could even go as far as having your iPhone app and desktop app communicate via WiFi to synch up data.

selecting video from local iphone like picker?

How can I select the video from photo folder or video folder and its file name which must be in iphone locally through programming?
Is there any way to check the video is already in iPhone locally, when i get file name of that
video from the internet?
I'm not 100% sure, but I think you might be looking for the UIImagePickerController.
If you want to pick a video from the library, or let the user record a video, use UIImagePickerController with the appropriate media types.
I don't think you'll be able to get its file name, though.