From c41e65bdeb1528a694799c5f02653148b52e7fee Mon Sep 17 00:00:00 2001 From: foamyguy Date: Wed, 27 Aug 2025 10:46:26 -0500 Subject: [PATCH] lower default volume limit, update examples, change warning message --- adafruit_fruitjam/peripherals.py | 4 ++-- examples/fruitjam_headphone.py | 2 +- examples/fruitjam_speaker.py | 2 +- examples/fruitjam_synthio_speaker.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/adafruit_fruitjam/peripherals.py b/adafruit_fruitjam/peripherals.py index 16a5dc0..0445e20 100644 --- a/adafruit_fruitjam/peripherals.py +++ b/adafruit_fruitjam/peripherals.py @@ -143,7 +143,7 @@ class Peripherals: See https://circuitpython.readthedocs.io/projects/neopixel/en/latest/api.html """ - def __init__(self, audio_output="headphone", safe_volume_limit=15): + def __init__(self, audio_output="headphone", safe_volume_limit=12): self.neopixels = NeoPixel(board.NEOPIXEL, 5) self._buttons = [] @@ -281,7 +281,7 @@ class Peripherals: f"Volume level must be less than or equal to " + f"safe_volume_limit: {self.safe_volume_limit}. " + f"Using higher values could damage speakers. " - + f"To override this limitation pass a value larger than 15 " + + f"To override this limitation pass a value larger {self.safe_volume_limit} " + f"for the safe_volume_limit argument of the constructor." ) diff --git a/examples/fruitjam_headphone.py b/examples/fruitjam_headphone.py index 434f6b6..decd1e5 100644 --- a/examples/fruitjam_headphone.py +++ b/examples/fruitjam_headphone.py @@ -8,7 +8,7 @@ import adafruit_fruitjam pobj = adafruit_fruitjam.peripherals.Peripherals(audio_output="headphone") FILES = ["beep.wav", "dip.wav", "rise.wav"] -VOLUMES = [5, 7, 10, 12, 15] +VOLUMES = [5, 7, 10, 11, 12] while True: print("\n=== Headphones Test ===") diff --git a/examples/fruitjam_speaker.py b/examples/fruitjam_speaker.py index f7a61b3..64ec015 100644 --- a/examples/fruitjam_speaker.py +++ b/examples/fruitjam_speaker.py @@ -8,7 +8,7 @@ import adafruit_fruitjam pobj = adafruit_fruitjam.peripherals.Peripherals(audio_output="speaker") FILES = ["beep.wav", "dip.wav", "rise.wav"] -VOLUMES = [5, 7, 10, 12, 15] +VOLUMES = [5, 7, 10, 11, 12] while True: print("\n=== Speaker Test ===") diff --git a/examples/fruitjam_synthio_speaker.py b/examples/fruitjam_synthio_speaker.py index f5c4d40..a44ce28 100644 --- a/examples/fruitjam_synthio_speaker.py +++ b/examples/fruitjam_synthio_speaker.py @@ -11,7 +11,7 @@ pobj = adafruit_fruitjam.peripherals.Peripherals(audio_output="headphone") synth = synthio.Synthesizer(sample_rate=44100) pobj.audio.play(synth) -VOLUMES = [5, 7, 10, 12, 15] +VOLUMES = [5, 7, 10, 11, 12] C_major_scale = [60, 62, 64, 65, 67, 69, 71, 72, 71, 69, 67, 65, 64, 62, 60] while True: print("\n=== Synthio Test ===")