File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 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):
574574 # 'utf-8' or 'mbcs' encoding. Let's try 'utf-8' first, because it more
575575 # likely raises an exception on 'mbcs' data than vice versa, see also
576576 # https://github.com/spatialaudio/python-sounddevice/issues/72.
577- # All other host APIs use 'utf-8' anyway.
578577 name = name_bytes .decode ('utf-8' )
579578 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 )):
583581 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 ())
584586 else :
585587 raise
586588 device_dict = {
You can’t perform that action at this time.
0 commit comments