Fix changing sound output not working

This commit is contained in:
Kovid Goyal 2023-02-02 12:43:10 +05:30
parent f464c71d61
commit 6bd4c506bb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 1 deletions

View File

@ -159,14 +159,20 @@ class Client:
try:
self.backend.set_voice(self.settings.get('voice'), self.default_system_voice)
except OSError:
import traceback
traceback.print_exc()
self.settings.pop('voice', None)
try:
self.backend.set_rate(self.settings.get('rate', self.default_system_rate))
except OSError:
import traceback
traceback.print_exc()
self.settings.pop('rate', None)
try:
self.backend.set_audio_device(self.settings.get('sound_output'), self.default_system_audio_device)
except OSError:
import traceback
traceback.print_exc()
self.settings.pop('sound_output', None)
if was_synthesizing:
self.resume_after_configure()

View File

@ -313,7 +313,7 @@ def parse_message(line):
return AllAudioDevices(**ans)
if msg_type == 'audio_device':
if ans['device']:
ans['device'] = DeviceInformation(ans['device'])
ans['device'] = DeviceInformation(**ans['device'])
else:
ans['device'] = None
return AudioDevice(**ans)