samirkumardas / pcm-player

A minimalist javascript audio player for PCM streaming audio
Other
294 stars 83 forks source link

Some changes/improvements #1

Closed Kjos closed 6 years ago

Kjos commented 6 years ago

Hi, you're library helped me out getting audio to work on my websocket desktopstreamer. I made some alterations you might consider implementing. See my own version here: https://github.com/Kjos/OculusGoStreamer/blob/master/website/pcm-player.js Since I use websockets I parse the msg.data as Int8Array immediately, leaving out the conversion afterwards. Also I use a BufferSource as actual buffer, no tmp array. This saves another iterated copy. I removed the interval method and act only on feed() call. It runs almost fine on mobile, although I get some noise which I'm not sure comes from my audio output or not. Last thing, I think there might be something to gain from slowing the plackbackRate slightly, my reasoning being there might be less seams, but thats just a theory.

samirkumardas commented 6 years ago

ok, will it support encoding 32bitFloat ?