|
|
|
@ -124,7 +124,7 @@ class Soundd: |
|
|
|
volume = ((weighted_db - AMBIENT_DB) / DB_SCALE) * (MAX_VOLUME - MIN_VOLUME) + MIN_VOLUME |
|
|
|
volume = ((weighted_db - AMBIENT_DB) / DB_SCALE) * (MAX_VOLUME - MIN_VOLUME) + MIN_VOLUME |
|
|
|
return math.pow(10, (np.clip(volume, MIN_VOLUME, MAX_VOLUME) - 1)) |
|
|
|
return math.pow(10, (np.clip(volume, MIN_VOLUME, MAX_VOLUME) - 1)) |
|
|
|
|
|
|
|
|
|
|
|
@retry(attempts=7, delay=3) |
|
|
|
@retry(attempts=10, delay=3) |
|
|
|
def get_stream(self, sd): |
|
|
|
def get_stream(self, sd): |
|
|
|
# reload sounddevice to reinitialize portaudio |
|
|
|
# reload sounddevice to reinitialize portaudio |
|
|
|
sd._terminate() |
|
|
|
sd._terminate() |
|
|
|
|