in python
I'd like to convert the wave file to float type and calculate it.
Is there any good way?
Could you teach me?
We have created an example of loading each WAVE file one frame at a time and returning it as a list of Floats.
import wave
import structure
from print import print
PATH="/path/to/some/audio.wav"
defmain():
with wave.open (PATH) as f:
length = f.getnframes()
flows = [struct.unpack('f', f.readframes(1))) for_inrange(length)]
print(floats)
return flows
if__name__=="__main__":
main()
7.1.structure—Interpreting byte columns as packed binary data—Python 3.6.5 document
22.4.wave—Reading and Writing WAV Files—Python 3.6.5 Documentation
© 2024 OneMinuteCode. All rights reserved.