From e33bd89cb1d4527aa4b788d2fbc5ffc7e673e413 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Tue, 2 Aug 2016 12:40:35 +0200 Subject: Use MBCS encoding for MME, too --- sounddevice.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sounddevice.py b/sounddevice.py index 874054a..c4edf33 100644 --- a/sounddevice.py +++ b/sounddevice.py @@ -620,12 +620,10 @@ def query_devices(device=None, kind=None): if not info: raise PortAudioError("Error querying device {0}".format(device)) assert info.structVersion == 2 - if info.hostApi == _lib.Pa_HostApiTypeIdToHostApiIndex(_lib.paDirectSound): - encoding = 'mbcs' - else: - encoding = 'utf-8' device_dict = { - 'name': _ffi.string(info.name).decode(encoding, 'replace'), + 'name': _ffi.string(info.name).decode('mbcs' if info.hostApi in ( + _lib.Pa_HostApiTypeIdToHostApiIndex(_lib.paDirectSound), + _lib.Pa_HostApiTypeIdToHostApiIndex(_lib.paMME)) else 'utf-8'), 'hostapi': info.hostApi, 'max_input_channels': info.maxInputChannels, 'max_output_channels': info.maxOutputChannels, -- cgit v1.2.3