iOS 17 web audio(audioContext) not sounding after playing several audios

246 Views Asked by At

I am building web audio player sdk. AudioContext is the one that play my audios. I have multiple audios which will play sequencially. Android(chrome), iOS16 (WKWebview) work well. (I am using AudioBufferSourceNode as well for the exact timing.)

But iOS17 (especially 17.1) is not working well.

It seems like working for the first few audios but after some audios, it sound no more. After this, trying again also doesn't work, the AudioContext should be created again. Is there any guide for this?

Apple made some changes for this and some people said it is fixed in 17 but not for my case. (https://discourse.threejs.org/t/audiocontext-ios-17/56482)

https://stackoverflow.com/questions/77137575/ios17-safari-audiocontext-web-audio-api-problem

https://developer.apple.com/forums/thread/740276

Test, test, test! And search the update release notes.

I'm expecting the audio plays well both iOS16 and iOS 17.

1

There are 1 best solutions below

1
On

navigator.audioSession.type = 'transient' got it working. But I got another problem. When silent mode is on by the device switch, it does not work again. Any idea? I tried seting AVaudiosession.setcategory playback with mixoption, but failed.