Skip to content
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

fix for #38 #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

fix for #38 #47

wants to merge 2 commits into from

Conversation

kgs233
Copy link

@kgs233 kgs233 commented Sep 17, 2024

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
Copy link
Owner

@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
Copy link
Author

kgs233 commented Sep 17, 2024

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
Copy link

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
Copy link
Author

kgs233 commented Sep 17, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants