.m4a file is not playing while uploading to server - iphone

In my app i am uploading .m4a music file from iphone library (storing in core data) which is downloaded from itunes, problem is the uploaded file is not playing (even in browser), some times the uploaded file is of 4MB size, in server it is showing 20KB. If i upload a .mp3 file it is perfectly uploading and perfectly playing. please help me.My code follows like this.
[request addData:[managedobject valueForKey:#"songData"] withFileName:[managedobject valueForKey:#"song_name"] andContentType:nil forKey:#"file"];
[request setPostValue:[managedobject valueForKey:#"song_extension"] forKey:#"extension"];

Try manually uploading the file to your server to verify that it will play at all... because of Apples Fairplay (http://en.wikipedia.org/wiki/FairPlay) DRM, I have had trouble playing songs bought off the store as well. However, if this is not the case, then recheck your upload code because something is wrong.

Related

How to download HLS/M3U8 chunks in ios device?

How to store locally m3u8 file with all chunks (.ts) from url in ios device.
If possible so how to do it?
I have developing functionality like.. Download .m3u8 file with chunks(.ts) in ios local storage then after modify .m3u8 and will play offline mode.
Please help me if have any kind of solution for above question.
The only way you can do this is to set up an HTTP server to serve the files locally after you've downloaded them.
Here are some related answers: Can IOS devices stream m3u8 segmented video from the local file system using html5 video and phonegap/cordova?

Copying music files of iphone library in my app

I want to copy the music files of iphone ipod library using MPMediaPicker. Actually using MPMediaPicker I am able to get the path of ipod music library but when I convert music file at url in NSData, the result is null. I doubt that is it possible to get the music file from ipod library. I am not sure as there is no exception or warning while I am trying to convert url item in NSData using [NSData datawithContentOfUrl:ipod-library-path].
If someone has any idea about this or any alternative to copy music files.
Your are getting Asset URLof music files.So it need to be converted into NSData to write into iphone library.
Refer Get video NSData from ALAsset url iOS link.
Now write data into iphone library.

Titanium Saving the Recorded Audio Files in a folder, Uploading audio files to Web Server,

How to save the file which is recorded in sound_record.js File from Appcellrator Titanium KitchenSick Demo.
file = recording.stop(); // file container TiFile Object
sound = Titanium.Media.createSound({sound:file}); // Sound Contains. TiMedia Object
I found these two lines which has the data, which is recorded, But i didnt get that, How to save these recorded data into iphone, so that they can have an access to these files which is recorded.
And also Uploading the Audio files to Web Server, Every where we have how to upload the Image which comes from Gallery, But there is no where its mentioned how we can upload the audio files such as .wav file which is recorded using sound_record.js.
I would checkout the KitchenSink, you'll find a lot of examples there. For saving I would checkout the filesystem.js and for upload the xhr_fileupload.js.

Not getting full download with NSURLConnection GET in iPhone app

Situation
I'm using NSURLConnection to download an mp3 file to the documents directory on my app. On the simulator I get the full mp3 file downloaded with no probs. On the device, however, I can only seem to get 1 second of audio for each mp3. I am connecting to a free WiFi point when performing this download from the device, in contrast with my T1 land-line connection that is used by the simulator.
Problem
Users of my app may encounter only partial downloads of mp3 files.
Question
Does this sound like a problem with the free WiFi hotspot rather than the actual app or NSURLConnection class? How should I go about troubleshooting this?
P.S. - I used to use [NSData dataWithContentsOfURL:URL] to download the mp3 file. It was very slow but at least I always got the ENTIRE mp3 file.
Thanks
Are you handling multiple callbacks of -connection: didReceiveData:? That will get called multiple times, and you should concatenate each data chunk into one giant NSMutableData.

Where are downloaded sound files saved?

When I download a sound file in my iPhone, in which directory is it stored?
There is no 'sound file directory'.
Safari cannot download files to the iPhone and if you download a sound file from code you will receive the data in an NSData object. From there it is up to you where you write the file (or even if you write a file, you could use the data without saving it). However you will still not have many options on where to save the file because of the iPhone sandbox.