Fix unspecified audio device

This commit is contained in:
Jack O'Sullivan 2023-04-23 23:41:19 +01:00
parent 5d1eb7bc7a
commit e4b977f75b

View File

@ -59,6 +59,8 @@ class Boardie:
self.device.grab()
self.pa = pyaudio.PyAudio()
if audio_device is None:
audio_device = self.pa.get_default_output_device_info()['index']
dev_info = self.pa.get_device_info_by_index(audio_device)
self.sample_rate = int(dev_info['defaultSampleRate'])
self.stream = self.pa.open(