Access iPhone User Songs and Videos? - iphone

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.

Related

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.

Wanted to know favorite play list songs of end users, should be on server or client side(sqlite) iPhone sdk?

Actually i am developing an app like net flix and in that i need to save favorite songs of end user, i am playing http live streamed videos and also i need to save played time of an video so that end user would be able to play a song from where he has left this song rather then just play it again from beginning.
They are sending me url of streamed videos in following format
http://xxxxxxxxxx/vod/definsts/mp4/low/mp4:1975010026_01.mp4/playlist.m3u8
so my question is that
What should be the best option to save user's favorite songs according to streamed url, means net flix kind of app having favorite songs in client side or at server side.what should be the preferred one and i am using MPMediaPlayerController from apple MoviePlayer sample app code.
If some one has any idea and want to know any thing more from my side then i will be available. I am and will be highly obliged for your any help.
Sorry but my English is not good and i don't know how to play with words.
Any small help or suggestion would be much appreciated.
Preferably your best option here looks like server side;
Saving the Data When you are removed from the application should be ultimately dealt with on the execution of the app to close.
you have multiple options when doing server Side Calls, One i found to be the best is ASIHTTPRequestDelegate
this has worked wonders and is fairly easy to learn.
You may even want to look into a REST method of pulling Video Feeds, may be a Faster and more secure approach.
hope this Helped! :)

How to copy a song from iPod Library to app?

In my application, I want to copy a song from iPod Library.
How can I do that?
Yes. It is possible, but hardly practical, to access raw song data. What you do from there is up to you. Here is a lengthy and detailed description of the process: http://www.subfurther.com/blog/?p=1103.
EDIT: Please be aware of App Store guideline 9.1 before making use of this technique. These guidelines require a developer login, so I've removed them from my post.
I think you can't.
Apple should not allow this !
Edit : see iPod Library Access Programming Guide but I don't think you can access to file. Just metadata.
if iMovie can do it, and they say it is done with all public API's they are in direct conflict with themselves...
Maybe this gives them wiggle room to allow you to post iPod library content to YouTube, since YouTube handles the appropriate detection of sensitive audio. This is sticky but here is the final solution you should learn from to do the job...iPodLibrary Music to PCM Samples revised
Checkout this it will helps you
https://github.com/davidcairns/MediaPlayerDemo

Creating YouTube videos in iPhone app

I'm doing a project where we want to create a video inside an iPhone app and upload it to YouTube. I've seen the you upload the video using Google's Data API (http://code.google.com/p/gdata-objectivec-client/).
However it seems that you need to upload the movie as an actual movie. Has anyone got any experience on making a movie in a format that YouTube will accept via the Data API and care to give me a few pointers on what would work?
(Just a quick note, I cannot use hidden APIs for this project)
Many thanks
Youtube accepts a broad range of formats. Just try it yourself, use any free video editing software to create a short movie and upload that movie to youtube, you're almost guaranteed that youtube would be able to process that.
The second part of your question is whether ios is able to produce a movie from still frames, then the answer is - yes - and you want to look at AVFoundation, particularly at AVAssetWriter

iPhone SDK: Is it possible to process audio file from local library

Well, I will try best not to make it as a 'I just want the code' question...
I'm recently working on a project which requires some audio signal processing from local music files (e.g. iTunes Library). The whole work includes:
Get the PCM data of an audio file (normally from iTunes library); <--AudioQueue (?)
Write the PCM data to a new file (it seems that Apple does not allow direct modification on music tracks); <--CoreAudio(?)
Do some processing and modification, like filters, manipulators, etc. <-- Will be developed in C++
Play the processed track. <--RemoteIO
The problem is, after going through some blogs and discussions:
http://lists.apple.com/archives/coreaudio-api/2009/Aug/msg00100.html, http://atastypixel.com/blog/using-remoteio-audio-unit/
http://osdir.com/ml/coreaudio-api/2009-08/msg00093.html
as well as the official sample codes, I got a feeling that the CoreAudio SDK allow us to apply audio processing only on voice demos recorded from Mic.
My question is that:
Can I get raw data from iTunes library tracks instead of Mic input?
If the first question is 'No', is there a way to 'fool' the SDK to let it think it is getting data from Mic input, not from iTunes? (I have done some similar 'hacking' stuff in C# before XD)
If the whole processing just doesn't work, can anyone provide some alternative ideas?
Any help will be appreciated. Thank you very much :-)
Thanks.
Just found something really cool yesterday.
From iPhone Media Library to PCM Samples in Dozens of Confounding, Potentially Lossy Steps
(http://www.subfurther.com/blog/?p=1103
And also a class library by MIT:
TSLibraryImport: Objective-C class + sample code for importing files from user's iPod Library in iOS4.
(http://bitbucket.org/artgillespie/tslibraryimport/changeset/a81838f8c78a
Hope they help!
Cheers,
Manca
1) No. Apple does not allow direct access to PCM data of songs. Otherwise you could create music-sharing apps, which is not in Apple's interests.
2) No. Hacking and getting approved is impossible due to Apple's code approval mechanism.
3) The only alternative I could think of is that you have to do the processing part on PC/Mac and then transfer it to the iPhone. Or you would have to store the files in your own applications folder - you should be able to load and process these via CoreAudio.
I know this thread is old but... did this work for you, Manca? And did this app get approved?
EDIT: just discovered the AVAssetReader class, introduced since iOS 4.1, should help