Skip to content

Conversation

@relic-se
Copy link
Contributor

@relic-se relic-se commented Nov 5, 2025

If you attempt to call stop_play() before calling play_file, the wavfile property will not be defined and throw an AttributeError. This fix simply declares this property as None within the constructor to prevent this error.

Board Definition

Adafruit CircuitPython 10.0.3 on 2025-10-17; Adafruit Fruit Jam with rp2350b

Example Code

import adafruit_fruitjam.peripherals
peripherals = adafruit_fruitjam.peripherals.Peripherals()
peripherals.stop_play()

REPL Output

(before fix)

Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
  File "adafruit_fruitjam/peripherals.py", line 336, in stop_play
AttributeError: 'Peripherals' object has no attribute 'wavfile'

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@FoamyGuy FoamyGuy merged commit 26619eb into adafruit:main Nov 6, 2025
1 check passed
@relic-se relic-se deleted the stop_play_wavfile_fix branch November 6, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants