diff --git a/src/custom_sfml_audio/open_music.cpp b/src/custom_sfml_audio/open_music.cpp index 1da750a..43951ff 100644 --- a/src/custom_sfml_audio/open_music.cpp +++ b/src/custom_sfml_audio/open_music.cpp @@ -11,6 +11,7 @@ #include #include "al_check.hpp" +#include "utf8_strings.hpp" #if defined(__APPLE__) #if defined(__clang__) @@ -24,7 +25,7 @@ OpenMusic::OpenMusic(const std::filesystem::path& filename) : m_file(), m_loopSpan(0, 0) { - if (not openFromFile(filename)) { + if (not openFromFile(to_utf8_encoded_string(filename))) { throw std::runtime_error("Could not open "+filename.string()); } } @@ -41,7 +42,7 @@ bool OpenMusic::openFromFile(const std::filesystem::path& filename) { stop(); // Open the underlying sound file - if (!m_file.openFromFile(filename)) { + if (!m_file.openFromFile(to_utf8_encoded_string(filename))) { return false; } diff --git a/src/editor_state.cpp b/src/editor_state.cpp index 924fc36..6914121 100644 --- a/src/editor_state.cpp +++ b/src/editor_state.cpp @@ -1459,7 +1459,7 @@ void EditorState::reload_preview_audio() { const auto path = song_path->parent_path() / song.metadata.preview_file; preview_audio.emplace(); - if (not preview_audio->openFromFile(path.string())) { + if (not preview_audio->openFromFile(to_utf8_encoded_string(path))) { preview_audio.reset(); } };