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
adafruit-adabot pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Nov 13, 2025
Updating https://github.com/adafruit/Adafruit_CircuitPython_FruitJam to 1.6.5 from 1.6.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_FruitJam#27 from relic-se/stop_play_wavfile_fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_Logging to 5.6.0 from 5.5.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_Logging#67 from fovea1959/module_level_calls
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