0

How to play the Byte[] in media player where data is coming from Doppler(BLE device for Heart Beat Sound). Data is in this form:

[85, -86, 9, -96, 53, 50, 24, -86, -103, -65, -72, 36, 67, 24, -102, -103, -103, -102, -67, -87, 55, 115, 24, 8, -22, -120, -119, -104, 20, 69, 0, -120, -54, -104, -103, -119, 36, 85, 0, -128, -5, -120, 8, 3, 98, -128, -128, -113, -80, -128, -128, 83, 0, -128, -118, -6, -128, 8, 36, 88, 8, 8, -51, -128, -120, 2, 66, 16, -128, -128, -34, -104, 8, 0, 82, 40, 8, 8, -81, -64, -128, -128, 52, 33, 8, 8, -113, -69, 0, -128, 82, 33, -120, -128, 25, -81, -55, -128, -126, 83, 16, -120, 0, 0, 34, -49, 0]

1st Byte array consists of 107 sound packets.

like this many sound datas are coming one after another from ble. How to Play this data in Media player continuously till we press Stop button.

In the document it is given like this:

This data include 107bytes, the last 3 bytes are extended bytes ( from Version 2.0) and it is used for transmitting 2 Data Vairants of ADPCM coding. Thus it can help to decode sound data correctly. Parity Sum occupies the 104th byte, it is Parity Sum of S1-S100. ADPCM Index & ADPCM Valpred: 2 coding variants before coding each sound data package.Receiver capture “ADPCM Index” from package, then value to “ADPCM Index”, then merge 8 high digits and 8 low digits of “ Valpred” into one “int”, then value to “ADPCM Valpred”, then decoding.

I need to Play this audio data simultaneously i need to save this data to a file

Any help or Working code sample is Much Appreciated. Thank you in Advance.

i have tried all these links but non is working for me :

Play sound directly from byte array - Java

Playing sound from a byte[] array

how to play pcm raw data in java

Community
  • 1
  • 1
kiran guled
  • 97
  • 1
  • 2
  • 10

0 Answers0