File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -574,13 +574,15 @@ def query_devices(device=None, kind=None):
574
574
# 'utf-8' or 'mbcs' encoding. Let's try 'utf-8' first, because it more
575
575
# likely raises an exception on 'mbcs' data than vice versa, see also
576
576
# https://github.com/spatialaudio/python-sounddevice/issues/72.
577
- # All other host APIs use 'utf-8' anyway.
578
577
name = name_bytes .decode ('utf-8' )
579
578
except UnicodeDecodeError :
580
- if info .hostApi in (
581
- _lib .Pa_HostApiTypeIdToHostApiIndex (_lib .paDirectSound ),
582
- _lib .Pa_HostApiTypeIdToHostApiIndex (_lib .paMME )):
579
+ api_idx = _lib .Pa_HostApiTypeIdToHostApiIndex
580
+ if info .hostApi in (api_idx (_lib .paDirectSound ), api_idx (_lib .paMME )):
583
581
name = name_bytes .decode ('mbcs' )
582
+ elif info .hostApi == api_idx (_lib .paASIO ):
583
+ # See https://github.com/spatialaudio/python-sounddevice/issues/490
584
+ import locale
585
+ name = name_bytes .decode (locale .getpreferredencoding ())
584
586
else :
585
587
raise
586
588
device_dict = {
You can’t perform that action at this time.
0 commit comments