Hi everyone.
Sorry to @sBenjamin , @kurtommy , @ckken and @mikes I was on holiday in a remote part of the country with no internet so I couldn’t reply sooner.
I’ll try my best to help, but please be aware that my usage was extremely specific to my requirements and I am by no means saying this is a GOOD solution, just that it worked for me, with that disclaimer out the way …
Another Ionic member @EddyVerbruggen (thank you so much again for your help Eddy, a truly patient, fantastic gentleman) and I worked on a plugin which can be found here: https://github.com/CirrusTech/cordova-audiorecorder-plugin
This helps record the audio in a format I deemed acceptable for Android. If you view the code you’ll see the exact settings used, this still created fairly large audio files, but I wanted them pretty clear, you can mess with the settings to decrease file size and find your own middle ground.
So for Android I did the following:
window.plugins.audiorecorder.record(onSuccess, onFailure);
While on iOS I did the following:
navigator.device.capture.captureAudio(onSuccess, onFail, {limit: 1, duration: 7});
I used a PHP script to upload the files to my server. Then in the PHP I did the following:
uploadOptions.mimeType = "audio/mp4";
uploadOptions.fileName = DTStamp + ".m4a";
uploadOptions is just an array passed to my PHP script (I can expand on this if anyone needs). DTStamp was just a date time stamp which is what I used to name the files and then saved them with an m4a extension. I am fully aware that the files recorded on iOS devices are not ACTUALLY m4a files, however they play as “m4a” files.
This resulted in audio files that would play on both Android and iOS devices, which is the issue I was having. Initially audio files recorded on Apple devices wouldn’t play on Android devices and vice versa, but with the method I’ve described anything played anywhere which was my requirement.
Let me know if you guys need anything else or if there’s anything else I can expand on
Good luck guys!