python - Convert byte array to signed big-endian 16-bit WAV -


i'm uploading pcm16 audio data android device server.

in java can this:

byte[] bytearray = // ...  bytearrayinputstream baiss = new bytearrayinputstream(bytearray);  audioformat format = new audioformat(samplerate, 16, 1, true, true); audioinputstream ais = new audioinputstream(baiss, format, bytes.size()); audiosystem.write(ais, audiofileformat.type.wave, new java.io.file(audiofilename)); 

but in python, audio sounds garbled because cant figure out how convert byte array signed big-endian 16-bit array.

how can convert byte array can save wav file?


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -