Interpreting WAV file BLE data.

I am using the HM10 ble module to send WAV file stored in SD card module to another HM10 ble connected via serial to a secondary computer. The data recieved on the other side is all numerical values and I am not able to interpret or convert them back to a WAV file. Any idea on how to convert these values back into a WAV file ?

Attached is the WAV file data recieved via BLE from the microcontroller. How to reconstruct this data back into a WAV file?

Edit:
I have uploaded the recieved wav file data as txt file (it is not continuous data anymore, added a new line after every data recieved)

ble data.txt (12.6 KB)

What do you know about the format? Bit depth? Number of channels? Sample rate?

Do you have a link to the HDMI module specs?

That looks like decimal, but I don't know how many digits make-up one sample... It's impossible to know where one sample begins and the next one begins...

The [u]WAV file format[/u] is fairly simple. You'll need to write the header, and then the audio data is simply a series of binary numbers representing the samples. (Of course the values will be automatically converted to binary when you write them to a file.)

You can look at a known-good WAV file with a [u]hex editor[/u]. Then when you write your file you can look at it with the hex editor to compare the headers. I recommend opening a short file since there are thousands of samples per second of audio.

If you can write the values to a file (as "numbers', not ASCII text) to a file, [u]Audacity[/u] can open the "raw data" and it can play the audio, or export as a normal WAV file. But since there is (apparently) no file header, you'll need to know (or guess) the bit depth, sample rate, etc., or the data will be scrambled and it will just sound like noise.

...Of course all of the data in any file is binary bytes but the hex editor will display the sample data (as well as everything else) in hexadecimal. It's easier (for a human) to read than binary and unlike decimal, each byte is represented by exactly one hex digit/character.

Hmm, a simple ascii histogram shows this is not simple sample data:
ASCII: count
0x30: 1412
0x31: 3789
0x32: 4999
0x33: 1655
0x34: 2542
0x35: 2921
0x36: 1066
0x37: 1145
0x38: 1070
0x39: 1146

The digits 2, 4, 5 are overrepresented (you'd expect 1 to be according to Benford's law, but this
isn't enough to explain this data).
I suspect the lack of separators means this data is simply broken and can't be used.

Nkvk06:
Attached is the WAV file data...

... which is useless garbage.

I guess (at best) the sender is repeatedly printing decimal values with no separators:
start of that data is:

1163216000101068172001368810201601009711697016260

That could be 1,1,6,3
or 11,63,21,6,0
or 116,32,160,0

You could try sending 2-character HEX values, at least you'd have a chance at reconstructing the original values.

Note that a simple Serial.print( bytevalue, HEX ) will not do this, since it prints single characters for values below 0x10

Yours,
TonyWilk

Post the code which sends the WAV file and the code which receives it - in

[code]...[/code]

tags - read How to post code properly.

The first four characters of a WAV file are "RIFF". I can't find anything in that data which looks like that.

Pete