and then I import the same sound
I have a different data array. The errors seem to have a certain regularity. They are all multiples of the same value:
Why does it happen? How can I get the same data?
First of all, thank you for the answers.
The raw data are here.
The code is as follows:
datiU2 = Import["https://pastebin.com/raw/sWmUzT9a", "List"];
datiU3 = SetPrecision[datiU2*2^-15, 16];
S1 = Sound[ListPlay[datiU3, SampleRate -> 44100, SampleDepth -> 16,
PlayRange -> {-1, 1}]];
dataS1 = List @@ S1[[1]];
dataS1[[1]][[1, 1 ;; 10]]
SetPrecision[
Export["OKDC.wav", S1, "AudioEncoding" -> "Integer16"], 16];
S11 = SetPrecision[Import["OKDC.wav"], 16];
dataS11 = SetPrecision[List @@ S11[[1]], 16];
dataS11[[1]][[1, 1 ;; 10]]
I added the SetPrecision commands after the first post to make a further attempt. I tried with AudioEncoding-> Integer24 and it does not change anything.
The problem is in the conversion that Mathematica does in command Export because if I read in Python the file "OKDC.wav" exported from Mathematica I see the raw values integer16 and they are different from those calculated in previous code by
dataS1[[1]][[1, 1 ;; 10]]*2^15