Record audio, compress / convert and upload

Hi vivek,

I use the plugin cordova-plugin-media-with-compression. It takes the same basis as cordova-plugin-media, but it adds a m4a compression on Android and IOS, only the file created when recording is not found using this extension.
I just think it does not work perfectly.
If you have any solutions, I’m interested.

1 Like

I used cordova capture plugin for video…it works fine…
But I need options to covert its size…e.g compress form 20mb to around 5mb…mp4 format…
in my cellphone its size is 50mb…for 10 sec…but while uploading it to remote server, it takes so much of time…
so I need to compress it to 5mb or less…
please send me controller code or php code…
email:gururaj9m@gmail.com

This saved my life, thank you

Hi fancyer86,

You have succeeded in make it work? It was broken at a time on Android, I found another solution, only it is dedicated server side “FFMPEG” or how to convert the media when his arrival on the server.

hello edwrede_ZA
Please how do i Upload Audio Files i already have them in M4a format all i want is to be able to upload them please i need your assistance Thanks in dvance

With some improvements in Chrome I kindly want to suggest a new option, after having tried a few options myself.

With the new MediaStreamRecorder API as in Chrome 49, it’s possible to directly record in .webm audio format. I believe that is possibly the smallest filesize you can achieve on the client before you upload to the server. Using the Crosswalk browser on Android also gives this capability to an Ionic project.

I’ve created a proof-of-concept recorder app here: https://github.com/TmanTman/AudioRecordIonic

Just add file upload (quite easy by reading the file and then uploading to something like Firebase Storage or S3) and it should be good to go!

Hi Tman,
Does the recorder app work on ios too…

Thanks

No, the app uses getUserMedia, which I don’t believe Apple has built into
browsers on iOS yet.

Will have to wait probably another year or so.

Google “iOS getUserMedia” to see current issues and status.

Thanks for getting in touch.

Regards,
Tielman

hello everyone,
hope your doing well with best wishes…

guys i am working on voice recording app…

voice recording manually (without native recoder) + with background effect (mp3 etc…)
ios and android

guys any help,suggestion or idea…
thanks

@mhartington hey mike, What’s up with the media plugin. the getDuration() function and getCurrentPosition() function both are not working. get duration is always -1 and getCurrentPosition doesn’t return anything. I have been stuck on this for days. theres no update bout this on phonegap or anywhere. No one’s replying on stackoverflow: https://stackoverflow.com/questions/45262147/ionic-media-plugin-getduration-and-getcurrentposition-does-not-work either regarding this issue. Any kind of help would be appreciated from you.

You need to play the record befor you use getDuration() function, then it will not be -1.