Is there a way to reduce (get rid of) the delay in playing audio (mp3) in iOS 13 safari/chrome browser? I have tried setting preload to "none" and also to "auto" but it doesn't seem to work in anyway. I'm using react h5 audio player.
Asked
Active
Viewed 1,325 times
3 Answers
0
I later found a hack to get rid of the delay. If the mp3 file is converted to 128kbps (or much better to 64kbps), this delay is gone. I hope this solution works out for others as well.

Waqqas Iqbal
- 31
- 5
-
Did you checked if its the issue with file size or not ? As downloading big file can delay it too as generally higher the bitsize ,higher the size of file – Sahil May 12 '20 at 18:36
-
1Yeah I did check that too. Smaller file is a good way to go but doesn't guarantee the instant playback on browsers in iOS devices. Reducing the bitrate guarantees delay free playback. – Waqqas Iqbal May 28 '20 at 15:58
0
I converted my audio file to base64 encoding so the audio is now inline text and doesn't need to be downloaded as an additional http call with latency.
Here's a base64 converter.
Naturally this solution doesn't work for every scenario, but if you've got a small/short audio file that doesn't require a lot of audio clarity, then the solution can work quite well.

brianpurkiss
- 1
- 2
-1
Try add:
const AudioContext = window.AudioContext || window.webkitAudioContext;
const audioCtx = new AudioContext();

Gynekolog
- 164
- 1
- 7
-
The source says it solves the problem for desktop safari. I did not face much of an issue in desktop safari but in mobile safari in iphone. I'll still try it out. – Waqqas Iqbal Jun 02 '20 at 10:28