Closed amunhoz closed 5 years ago
Getting noise means it was not converted into PCM properly Or number of channel issue. According to the server code, number of channels are two but in client side it is one.
Note this library convert raw opus packet (without ogg container ) into PCM. If you have already ogg container, you don't need this library, you can directly use decodeAudioData to convert into PCM
Thanks for the answer... however i've changed to one channel and same thing. About de encoding, i'm using https://www.npmjs.com/package/prism-media, wich i believe does raw encoding with a separated function to use ogg container. Tried too with https://www.npmjs.com/package/cjopus, wich is a direct interface to libopus.
Any ideas?
I've found a way to make it work. I was using your player from: https://github.com/samirkumardas/pcm-player
When i used the player from the example, everything worked fine. Is there any specific config to use it with the previous player?
then it must be encoding issue. In the example I took 32bitFloat
as my example data was so.
Anyways, you can define encoding 32bitFloat
while PCM player instantiating. For example:
var player = new PCMPlayer({
encoding: '32bitFloat',
channels: 2,
sampleRate: 8000,
flushingTime: 2000
});
I'm trying to stream a pulseaudio pcm to web browser, but i only get noise. Any help? Thanks in advance
Here is the code: nodejs
html client
** Updated to 1 channel everywhere