mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 19:50:12 +01:00
path encoding uses utf-16 on windows
This commit is contained in:
@@ -179,6 +179,9 @@ class AudioEngine:
|
|||||||
def load_sound(self, file_path: Path, name: str) -> str:
|
def load_sound(self, file_path: Path, name: str) -> str:
|
||||||
"""Load a sound file and return sound ID"""
|
"""Load a sound file and return sound ID"""
|
||||||
try:
|
try:
|
||||||
|
if platform.system() == 'Windows':
|
||||||
|
file_path_str = str(file_path).encode('utf-16')
|
||||||
|
else:
|
||||||
file_path_str = str(file_path).encode('utf-8')
|
file_path_str = str(file_path).encode('utf-8')
|
||||||
sound = lib.load_sound(file_path_str) # type: ignore
|
sound = lib.load_sound(file_path_str) # type: ignore
|
||||||
|
|
||||||
@@ -293,6 +296,9 @@ class AudioEngine:
|
|||||||
# Music management
|
# Music management
|
||||||
def load_music_stream(self, file_path: Path, name: str) -> str:
|
def load_music_stream(self, file_path: Path, name: str) -> str:
|
||||||
"""Load a music stream and return music ID"""
|
"""Load a music stream and return music ID"""
|
||||||
|
if platform.system() == 'Windows':
|
||||||
|
file_path_str = str(file_path).encode('utf-16')
|
||||||
|
else:
|
||||||
file_path_str = str(file_path).encode('utf-8')
|
file_path_str = str(file_path).encode('utf-8')
|
||||||
music = lib.load_music_stream(file_path_str) # type: ignore
|
music = lib.load_music_stream(file_path_str) # type: ignore
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user