@@ -83,7 +83,8 @@ def __init__(self, audio_output="pwm", seconds_per_eighth=0.25):
8383 # Initialize TLV320
8484 fjPeriphs = adafruit_fruitjam .Peripherals (
8585 audio_output = launcher_config ["audio" ].get ("output" , "headphone" ),
86- safe_volume_limit = launcher_config ["audio" ].get ("volume_override_danger" ,12 ),
86+ safe_volume_limit =
87+ launcher_config ["audio" ].get ("volume_override_danger" ,.75 ),
8788 sample_rate = 11025 ,
8889 bit_depth = 16 ,
8990 i2c = board .STEMMA_I2C ()
@@ -103,7 +104,8 @@ def __init__(self, audio_output="pwm", seconds_per_eighth=0.25):
103104 # Initialize TLV320
104105 fjPeriphs = adafruit_fruitjam .Peripherals (
105106 audio_output = launcher_config ["audio" ].get ("output" , "headphone" ),
106- safe_volume_limit = launcher_config ["audio" ].get ("volume_override_danger" ,12 ),
107+ safe_volume_limit =
108+ launcher_config ["audio" ].get ("volume_override_danger" ,.75 ),
107109 sample_rate = 11025 ,
108110 bit_depth = 16 ,
109111 i2c = board .I2C ()
@@ -112,10 +114,8 @@ def __init__(self, audio_output="pwm", seconds_per_eighth=0.25):
112114 self .tlv = fjPeriphs .dac
113115
114116 # If volume was specified use it, otherwise use the fruitjam library default
115- if "volume_override_danger" in launcher_config ["audio" ]:
116- fjPeriphs .volume = launcher_config ["audio" ]["volume_override_danger" ]
117- elif "volume" in launcher_config ["audio" ]:
118- fjPeriphs .volume = launcher_config ["audio" ]["volume" ] # FruitJam vol (1-20)
117+ if "volume" in launcher_config ["audio" ]:
118+ fjPeriphs .volume = launcher_config ["audio" ]["volume" ] # FruitJam vol 0.0-1.0
119119
120120 # Setup I2S audio output - important to do this AFTER configuring the DAC
121121 # Fruitjam library actually does this before we modify the configuration
0 commit comments