Code
import numpy as np
from scipy.io import wavfile
fin = open("data2.bin","rb")
dt = fin.read()
npdt = np.array(list(dt),dtype="int16")
npdt = (npdt-int(npdt.mean()))*256
wavfile.write("ses2.wav",8000,npdt)
Python – Bytes to Wav File
while (!endOfLife) { enjoy(); }
while (!endOfLife) { enjoy(); }
Code
import numpy as np
from scipy.io import wavfile
fin = open("data2.bin","rb")
dt = fin.read()
npdt = np.array(list(dt),dtype="int16")
npdt = (npdt-int(npdt.mean()))*256
wavfile.write("ses2.wav",8000,npdt)