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 -

Python Tornado package error when running server -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -