code.py output:
Playing random file
Code: Select all
Traceback (most recent call last):
File "code.py", line 112, in <module>
File "code.py", line 57, in playRandom
File "adafruit_circuitplayground/circuit_playground_base.py", line 834, in play_file
File "adafruit_circuitplayground/circuit_playground_base.py", line 832, in play_file
MemoryError: memory allocation failed, allocating 512 bytes
Code: Select all
# dictionary defining the random files that can be selected from
playFile = {1 : "meow.wav", 2 : "hiOwen.wav"}
def playRandom():
print("Playing random file")
cp.play_file(playFile[random.randint(1, 2)])
Is there any way to work around this issue? I have double checked the wav files are mono 16 bit, 22 khz as specified by circuit python recommendations.
THANKS!!!