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
Post a Comment