flipswitchingmonkey / FlexASIO_GUI

Simple configuration GUI for FlexASIO
MIT License
336 stars 26 forks source link

fix for #38 #47

Open kgs233 opened 5 days ago

kgs233 commented 5 days ago

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.

flipswitchingmonkey commented 5 days ago

@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...

kgs233 commented 5 days ago

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. However, the code that needs to be merged is fine, but the logic of the fix is a bit wrong.

dechamps commented 5 days ago

PortAudio no longer uses ANSI strings internally but Unicode strings instead

PortAudio always returns device names as UTF-8, and as far as I know that has always been the case.

kgs233 commented 5 days ago

PortAudio no longer uses ANSI strings internally but Unicode strings instead

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.