I am working on developing an iPhone app to play music. Am using AudioQueue services to play the audio files. App plays all media files correctly, but the app fails to play audiobooks, which I think is because they are different media format (.m4b) from other media items in my library (mp3).
I am sure I need to change how am initializing the audioqueue or AVAssetReaderTrackOutput to play media with different file format but am not sure how.
Can anyone point me to right direction.
Thanks in advance
I have figured it out, the issue was not because of the media format. The Audiobook I was trying to play in my app was DRM protected, so the was unable to play it.
Thanks
Related
I am new to iPhone Development. I need to capture video. While I'm capturing video it display on server too. Something like live streaming.
Anyone have idea from where I should have to start for this functionality?
Thanks in Advance.
Your question seems similar to this
Xcode ios: Streaming of video file while recording and removed redundant personal statements
First Half Solution
Using AVFoundation you can get video Buffer/frames while recording.
Second Half
But for uploading i didn't find any solution
There is Input Stream option there in iOS APIs but it need some file path. but as video is not recorded we didn't have any path.
Edit 1
Here is Best Example for AVFoundation provided by Apple, you can start with
I recommend you to use wowza wowza.com/https://www.wowza.com, it has all the features, from live stream, video on demand and etc.
Is it possible access raw PCM data from the iphone audio output?
I know I can embed an MP3 and use AudioUnit. But if the user is playing music in the background from their itunes library, is it possible to access that audio data?
This is for an app that shows visual effects, which react to the music.
From what I can tell, it isn't possible, but that's just from lack of finding any information at all, rather than actual confirmation that it can't be done.
If it isn't possible to access the audio stream from the ipod, is it possible to access raw audio output from the Media Player inside an app, or is pretty much not permitted to access raw audio data from the itunes library at all?
EDIT: I found this question: iOS - Access output audio from background program, which say I can't access the audio from a background app. But is it possible to get the audio data from the itunes library if I play it inside the app?
I am busy coding something similar and as far as I know an AUGraph is needed, the hardware pulling from the recorder. You will have to get the URL of the MPMediaItem from the track the user selected with Apple's MPMediaPickerViewController. Then use the URL with Core-Audio. Core-Audio is a beast.
If your app is playing raw audio PCM samples, then your app has access to those samples. An app does not have access to the audio samples that another app (including the Music player) is playing via any public API.
An app can use AVAssetReader and Writer to convert mp3 files from the iTunes Library into raw audio (WAV) files.
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 want to apply post-processing to audio from an iPhone user's music library (i.e. the iPod app). This could happen in a number of ways:
Piping the media player's output through an Audio Unit.
Writing a custom audio output device, and having the media player send audio to it.
Getting direct access to the files in the user's music library.
Are any of these things possible? I know all of them would be on the desktop, but what about the iPhone?
I've written some sample code that does just this, which is based on some code from Chris Adamson.
I am building this iphone app for a client and they have a large set of flash video files that they need to play/stream to the iphone. I understand that the iphone doesnt natively support flv playback but isnt there anything I can do to get around this problem?
In case it helps, they are using the akamai flash player on their website to play these video files.
Thanks in advance.
Yes! - You can convert all the videos to m4v format.
There's a javascript hack available, but it will only work if it's installed on the clients web server. It's also pretty clunky and slow and will likely murder battery life.
A workaround, since you're working with video, is to convert to mp4 format.
Short answer: no flash, but conversion will do what you need.
akamai actually supports "auto-packaging" of h.264 content which may be your best option here. By uploading 1 or more h.264 files you can use those to both serve your Flash player, and akamai will also auto-package them for iPhone (chunking them into .ts files and creating an .m3u8 reference file for dynamic mobile streaming).
This allows you to not have separate encodes for mobile and web, thus saving money and time so you can leverage your existing archive.