0

Can WaveFile be used to read sample values?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Can WaveFile be used to read sample values?

by kevinjwalters on Fri Feb 19, 2021 10:21 am

Is there anyway to use CircuitPython's WaveFile to read (and then process) the sample values in a .wav file?

kevinjwalters
 
Posts: 883
Joined: Sun Oct 01, 2017 3:15 pm

Re: Can WaveFile be used to read sample values?

by tannewt on Fri Feb 19, 2021 9:41 pm

Not currently. CPython does have a wave module you could use.

tannewt
 
Posts: 2189
Joined: Thu Oct 06, 2016 8:48 pm

Re: Can WaveFile be used to read sample values?

by kevinjwalters on Sat Feb 20, 2021 9:03 am

For anyone else interested, I've had some success with downloading https://raw.githubusercontent.com/pytho ... ib/wave.py and https://raw.githubusercontent.com/pytho ... b/chunk.py (a dependency) and with this code:

Code: Select all | TOGGLE FULL SIZE
import sys
# wave imports audioop but does not use it on little endian processors
sys.modules['audioop'] = None
import wave

kevinjwalters
 
Posts: 883
Joined: Sun Oct 01, 2017 3:15 pm

Please be positive and constructive with your questions and comments.