Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

error when playing files with certain characters #33

Open
jimmy-taylor-1 opened this issue Mar 7, 2024 · 4 comments
Open

error when playing files with certain characters #33

jimmy-taylor-1 opened this issue Mar 7, 2024 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@jimmy-taylor-1
Copy link

When I try to play files that have Japanese characters in the file name I get the error

line 235, in __bind
    raise MiniaudioError(MA_RESULT_STR[ma_res])
just_playback.ma_result.MiniaudioError: MA_DOES_NOT_EXIST

the same might happen with other characters as well but I haven't tested it

@cheofusi
Copy link
Owner

Hi @jimmy-taylor-1,

Could you try installing v0.1.8 ? Let me know if it solves your problem.

@jimmy-taylor-1
Copy link
Author

Unfortunately this seems to have made the problem worse, now i get this error for every file I try to play

line 55, in load_file
    self.__bind(lib.load_file_w(self.__ma_attrs, path_to_file.encode('utf-16le')))
TypeError: initializer for ctype 'wchar_t *' must be a cdata pointer, not bytes

@Hanzyusuf
Copy link

Unfortunately this seems to have made the problem worse, now i get this error for every file I try to play

line 55, in load_file
    self.__bind(lib.load_file_w(self.__ma_attrs, path_to_file.encode('utf-16le')))
TypeError: initializer for ctype 'wchar_t *' must be a cdata pointer, not bytes

I was getting the same error, even when directly compiling from source. I got mine working by simply removing the encoding,

so from:

if platform.system() == 'Windows':
        self.__bind(lib.load_file(self.__ma_attrs, path_to_file.encode('utf-16le')))

to:

if platform.system() == 'Windows':
        self.__bind(lib.load_file(self.__ma_attrs, path_to_file))

Also, when compiling from source, there is a little bit difference in the code, but you can still remove the utf16le encoding part completely and it will solve the issue.

Note: this isn't the right solution and we should perform some type of validation before deciding and going on with the encoding, but works for now.

@cheofusi cheofusi added the duplicate This issue or pull request already exists label Mar 13, 2024
@cheofusi
Copy link
Owner

I've updated the wheels on PyPI. Uninstalling and then reinstalling v0.1.8 should fix this issue.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants