-
Notifications
You must be signed in to change notification settings - Fork 28
fix for #38 #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix for #38 #47
Conversation
@vasilevp Do you want to review and merge it? I have moved almost entirely to MacOS and have not used flexASIO in ages, let alone worked on the repo... |
I think I may be mistaken about what's causing the problem, it's actually the fact that PortAudio no longer uses ANSI strings internally but Unicode strings instead, so that causes the old PortAudio-sharp string mapping to garble errors. |
PortAudio always returns device names as UTF-8, and as far as I know that has always been the case. |
But I found something in PortAudio about ANSI string changing to UTF-8 string, so I'm guessing that a long time ago (when PortAudio-Sharp was developed) PortAudio used to use ANSI strings to return the device name. |
Hi! Bit late to the party... I've also moved away from Windows some time ago (and stopped using flexASIO long before that). I did, however, try to run this in a VM and got the following: [output]
device = "Динамики (High Definition Audio Device)\u0000" Note the This trailing zero comes from Portaudio and only for this Cyrillic-named device in my case, so there's got to be some weirdness in there. |
This is a P/Invoke issue, I upgraded the dependency library to support UTF-8 string, it's fixed now. Also, along the way I fixed the issue where the program failed to start when configuration files were read incorrectly (#42), now it automatically resets them on configuration errors. |
portaudio-sharp uses LPStr as a string mapping method, this will lose some of the data for non-ANSI strings.
Changing the string mapping of the name member of PaDeviceInfo in portaudio-sharp from LPStr(ANSI) to LPWStr(Unicode) solves the problem perfectly.Changing the string mapping of the name member of PaDeviceInfo in portaudio-sharp from LPStr(ANSI) to LPWStr(Unicode) solves the problem perfectly.