fix for whitespace in icom radio sound device names

This commit is contained in:
xssfox 2023-12-31 19:53:30 +11:00
parent 1d542d489b
commit 864e56f4ca

View file

@ -28,7 +28,7 @@ class AudioDevices:
input_channels = device_info['maxInputChannels'],
output_channels = device_info['maxOutputChannels'],
sample_rate = int(device_info['defaultSampleRate']),
name = device_info['name'],
name = device_info['name'].strip(),
id = x
))
def __str__(self):
@ -79,6 +79,9 @@ class InputDevice():
self.callback = callback
self.bit_depth = pyaudio.get_sample_size(FORMAT)
if type(name_or_id) == str:
name_or_id = name_or_id.strip()
if name_or_id != None:
try:
self.device = next(
@ -187,6 +190,9 @@ class OutputDevice():
self.send_queue = []
self.modem = modem
if type(name_or_id) == str:
name_or_id = name_or_id.strip()
if name_or_id != None:
try:
self.device = next(