-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Labels
Description
Hi, I've just implemented audio messages in one of apps that I'm working on. Since the app runs on both iOS and Android the only file format that I used was .aac.
Problems that have arisen here we the following:
- If you record on Android phones that have Android 10 and above, and save the recording as .aac, iOS was not able to process the data about the recording - giving PlatformException - InvalidAudio. Resolution here is to save files as .m4a when recording on Android, then iOS is able to parse the recording data accordingly.
- If you record on iOS and save as .aac MediaInfo would give C.TIME_UNSET constant as data for 'durationMs'. In order to fix this I had to fork the package you've created and change the logic for gathering data about duration, by bypassing ExoPlayer and using directly android.media.MediaMetadataRetriever which works like charm.
I am not sure how well android.media.MediaMetadataRetriever works with other audio formats but it fixed the issue for me with .aac.
If you want me I'll submit a PR that adjusts the retrieval of duration for audio files.
Kind regards.