2

I want to play a stream of audio blobs that came from a MediaRecorder
I have a website containing this piece of javascript angular code:

enter image description here This is a MediaRecorder of type https://developer.mozilla.org/nl/docs/Web/API/MediaRecorder

enter image description here

This sends the data from the MediaRecorder in 'audio/webm' format to the server

Server:

enter image description here

All this does is relay the blobs coming in from the MediaRecorder to all the connected clients

Apps (Connected clients)

enter image description here

This console logs:

enter image description here

And:

enter image description here

How can I play this audio blob stream on the client side?

ErikBrandsma
  • 1,661
  • 2
  • 20
  • 46

1 Answers1

0

OK, I solved this one some time ago by adding an encoding to the ByteArrays which were being sent

ErikBrandsma
  • 1,661
  • 2
  • 20
  • 46
  • 1
    Could you give more information? I am having exact same issue. Little more info will help me solve this issue :) – Sisir May 23 '20 at 11:53
  • @Sisir yeah, so the bytes that were coming from the MediaRecorder were raw, you have to add some kind of encoding to them, in my case .wav to ensure that the bytes are ordered and read in the same way – ErikBrandsma May 24 '20 at 12:08
  • I have posted a Q can you take a [look into it](https://stackoverflow.com/questions/61971649/how-to-play-audio-data-stream-coming-via-socket-io-into-a-html5-audio-player)? I think I am doing something else wrong. – Sisir May 24 '20 at 13:28