Audios recorded with iOS Safari MediaRecorder have no duration

I have an issue with MediaRecorder output having no metadata on duration of the audio file.
On Android, I used this answer to fix it already by parsing the EBML headers.

On iOS, WebM is not supported and the output is an .mp4 file even though I only record audio. Is there any similar solution?