From e4b977f75bf7b4f656a691efca492ae057672a77 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Sun, 23 Apr 2023 23:41:19 +0100 Subject: [PATCH] Fix unspecified audio device --- boardie/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boardie/__init__.py b/boardie/__init__.py index 23b397e..007307a 100644 --- a/boardie/__init__.py +++ b/boardie/__init__.py @@ -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(