Phonegap uploaded audio file not being played in browser

427 Views Asked by At

I am uploading a recorded mp3 file using phonegap and php

Recording - Using Media object (media.startRecord/ media.stopRecord) - Successful

Uploading - ft.upload(fileURI, encodeURI("http://some.server.com/upload.php"), win, fail, options); In options, I am using options.mimeType = "audio/mpeg";

-This is also successful

Playing - But when I try to play it in browser as http://some.server.com/media_uploaded.mp3 - It tries to play but fails after sometime. I tried playing the same file with http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_audio_all as well, but couldn't succeed.

When I download the same file - it gets played without any error in any media player in my computer.

When I upload any mp3 song at same place - it gets played successfully with - http://some.server.com/song_uploaded.mp3

What can be possible problem(s) with my recorded audio?

Update

Just noticed that problem has nothing to do with 'Upload'. The saved mp3 (when copied to PC) seems to run fine on my computer but not on browser (Even locally - I checked with Audio tag as well). So there is something wrong with the recorded mp3. Not sure what is the solution.

Not working - http://xpertvisions.com/test/media_recorded.mp3

Working - http://xpertvisions.com/test/media_song.mp3

1

There are 1 best solutions below

0
On

I found a solution to this that I answered here --> https://stackoverflow.com/a/23140836/902630

This is, however, a .Net solution. But looking at it may help lead you in the right direction.