File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -620,12 +620,10 @@ def query_devices(device=None, kind=None):
620620 if not info :
621621 raise PortAudioError ("Error querying device {0}" .format (device ))
622622 assert info .structVersion == 2
623- if info .hostApi == _lib .Pa_HostApiTypeIdToHostApiIndex (_lib .paDirectSound ):
624- encoding = 'mbcs'
625- else :
626- encoding = 'utf-8'
627623 device_dict = {
628- 'name' : _ffi .string (info .name ).decode (encoding , 'replace' ),
624+ 'name' : _ffi .string (info .name ).decode ('mbcs' if info .hostApi in (
625+ _lib .Pa_HostApiTypeIdToHostApiIndex (_lib .paDirectSound ),
626+ _lib .Pa_HostApiTypeIdToHostApiIndex (_lib .paMME )) else 'utf-8' ),
629627 'hostapi' : info .hostApi ,
630628 'max_input_channels' : info .maxInputChannels ,
631629 'max_output_channels' : info .maxOutputChannels ,
You can’t perform that action at this time.
0 commit comments