Home > Net >  Play audio data from java ByteArray
Play audio data from java ByteArray

Time:02-10

I am new to Java as well as audio data encoding. I have an android app that connects to a digital device (digital stethoscope), grabs the device's raw data in shorts and then converted to ByteArray for audio data.

Now I have a ByteArray audio data, I want to stream and play it on a webpage. I'm using web sockets to stream this data into a web server in Node.JS and able to send the audio data with the format intact. I have the following in console log which indicates the audio data in buffer: enter image description here

The audio data are sent to listening web clients with the actual format, and I want to play this audio data in th webpage without having an actual audio file from the server. Question becomes 'Is it possible?' and if it is, can anyone provide a simple example on how to do it? I have been digging some nice articles and questions in Stackoverflow but none had suffice so far.

CodePudding user response:

  •  Tags:  
  • Related