I am new to iphone programming. Can any body tell me that how to manually add audio files inside the photo gallery? I got some link like we can manually add video inside the simulator but that is only video. I want audio files,too. I have searched in google but I didnt find any where how to add audios files inside photo gallery.
Please can any body tell me.
Thanks
The iPhone's photo gallery does not support audio files.
You can not add audio files to Photo Library. But you can use iPod Library Access Programming Guide for same approach.
Also refer AddMusic demo. AddMusic demonstrates basic use of iPod library access, part of the Media Player framework. You use iPod library access to play songs, audio books, and audio podcasts that are synced from a user's desktop iTunes library. This sample uses the Media Player framework's built-in user interface for choosing music.
AddMusic also demonstrates how to mix application audio with iPod library audio
Related
When a song gets placed into itunes and then synced to iphone does it automatically put DRM on it?
I'm trying to copy an mp3 I wrote into a unity3d game on the iphone and play it and use it to make a video of the game.
This fails:
I wrote a song it does not have DRM. I dropped it into itunes and sync up the phone.
I then use an iphone plugin for unity3d that copies it from from the iphone music library to a directory in the game. I can then play the song and create a video of the game with the song. Playing the song works fine. But when I try to access the data using AVAssetExportSession to create the video it cannot find the audio tracks of the mp3.
This succeeds:
But if I paste the song directly into the game directory by dragging it from itunes into the game library it has no problem with the song or finding the audio tracks and creating the video.
Can anyone explain why this is failing. Is it a DRM issue?
Thanks,
To answer the question in the title directly: No, all songs are not automagically DRM protected while on the iPhone.
That being said, you do need to jump through a few hoops if you want to get the song data, and AVAssetExportSession is a good way to do that.
The problem you are having really doesn't sound like a DRM issue. It sounds like a path/URL problem for the audio file. Some example code would help to better answer the other parts of your question.
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.
I was looking to code an iPhone application however, i was not sure if the following is possible :
Download an mp3 from an external site (through the application)
Once the mp3 has been downloaded, automatically add it to the usual iPod application, so it is visible in the user ipod songs list.
Same for videos too (download video[mp4] and directly transfer it to the usual videos app)
If the above is not possible, can i directly play the downloaded mp3 in my application ? What would i require to play an mp3 in my application ? Are there open source mp3 players available that i can integrate with my application ?
Thanks for any help, i really appreciate it.
Once the mp3 has been downloaded, automatically add it to the usual iPod application, so it is visible in the user ipod songs list.
No, that's not possible. The iPod library is not writable by third-party apps.
Same for videos too (download video[mp4] and directly transfer it to the usual videos app)
Not possible, either.
suppose i load videos to an iPhone using iTunes.
I want to write an app that will allow the selection of videos, and the playing of them.
I am familiar with the MPMoviePlayerController class. but i only played video that i loaded onside my app.
Apple doesn't let you access the movies of the iPod application. You can only access audio files.
From the docs
Use it to find and play user-installed
audio-based media items synced from a
user’s iTunes library. iPod library
access is read-only.
Link
i have built an iphone application which makes a video and than you can record the video further. now the main part or my application is that i want to upload it to youtube or e-mail it. now conventionally you take a video or picture for instance from the gallery and using the camera roll feature.
can i utilize that feature in my own application so that after i have recorded a video through my iphone application i dont have to go back to the camera roll feature which is there in the iphone built in gallery.
It doesn't look like you can get access to those features within your app.
You'll have to implement these features yourself.