- Published on
pythonでBinaryとBytesを相互変換
- Authors
- Name
- Kikusan
wavfile = open(config.WAV, 'rb') #read bynary
print(type(wavfile))
bwav = wavfile.read() # InmemoryStream to bytes
print(type(bwav))
wavfile2 = BytesIO(bwav) # bytes to InmemoryStream
print(type(wavfile2))