samirkumardas/pcm-player

not working on safari too

this-spring opened this issue · 6 comments

the lib can not play in safari.
sampleRate 44100
live stream by webscocket

Can you provide any demonstration?

Can you provide any demonstration?

emmm, i receive opus by websocket. i decode opus to pcm by wasm. i use pcm-player play the pcm data, it is fine in chrome. it not working in safari.

I feel that Safari can only call the flush interface once, and it will not play the sound for many calls. It is called many times when it is live, so it can not play.

well, Safari has a buggy implementation of web audio. Though so far I remember it was fine when sampleRate > 22050
I will re-check

well, Safari has a buggy implementation of web audio. Though so far I remember it was fine when sampleRate > 22050
I will re-check

ok, thanks, my pcm sampleRate is 44100, you can test.

pkjy commented

well, Safari has a buggy implementation of web audio. Though so far I remember it was fine when sampleRate > 22050
I will re-check

ok, thanks, my pcm sampleRate is 44100, you can test.

I have just do some work with Safari several weeks ago ,And here's some experience:

  1. safari can only play above 22050 Hz data. see safari-webkitaudiocontext-createbuffer-api-raises-notsupportederror-exception
  2. when safari's recording ,data's samplerate is always 48000 . even though I set other values.
  3. safari only accept 4 AudioContext instance ,and fail in the fifth one.

other experience I've come up with can be found in websocket pcm webaudio experience

If you find a solution, I will appreciate PR. Don't need to post anything else.