Commit 204c769a authored by mercury233's avatar mercury233

fix

parent 787f78d6
#include "sound_manager.h"
#include "myfilesystem.h"
#if defined(YGOPRO_USE_MINIAUDIO) && defined(YGOPRO_MINIAUDIO_SUPPORT_OPUS_VORBIS)
#include <miniaudio_libvorbis.h>
#include <miniaudio_libopus.h>
#include <miniaudio_libvorbis.h>
#endif
#ifdef IRRKLANG_STATIC
#include "../ikpmp3/ikpMP3.h"
......@@ -263,13 +263,7 @@ void SoundManager::PlayMusic(char* song, bool loop) {
StopBGM();
#ifdef YGOPRO_USE_MINIAUDIO
strcpy(currentPlayingMusic, song);
#ifdef _WIN32
wchar_t song_w[1024];
BufferIO::DecodeUTF8(song, song_w);
ma_sound_init_from_file_w(&engineMusic, song_w, MA_SOUND_FLAG_ASYNC | MA_SOUND_FLAG_STREAM, nullptr, nullptr, &soundBGM);
#else
auto res = ma_sound_init_from_file(&engineMusic, song, MA_SOUND_FLAG_ASYNC | MA_SOUND_FLAG_STREAM, nullptr, nullptr, &soundBGM);
#endif
ma_sound_init_from_file(&engineMusic, song, MA_SOUND_FLAG_ASYNC | MA_SOUND_FLAG_STREAM, nullptr, nullptr, &soundBGM);
ma_sound_set_looping(&soundBGM, loop);
ma_sound_start(&soundBGM);
#endif
......
......@@ -117,7 +117,8 @@ project "miniaudio"
"external/opusfile/include",
"external/vorbis/include",
}
defines { "OPUS_BUILD", "USE_ALLOCA",
defines {
"OPUS_BUILD", "USE_ALLOCA",
"OPUS_X86_PRESUME_SSE", "OPUS_X86_PRESUME_SSE2",
"OPUS_HAVE_RTCD", "OPUS_X86_MAY_HAVE_SSE", "OPUS_X86_MAY_HAVE_SSE4_1", "OPUS_X86_MAY_HAVE_AVX2",
}
......
......@@ -12,6 +12,7 @@ USE_AUDIO = true
AUDIO_LIB = "miniaudio"
MINIAUDIO_SUPPORT_OPUS_VORBIS = true
MINIAUDIO_BUILD_OPUS_VORBIS = os.istarget("windows")
IRRKLANG_PRO = false
IRRKLANG_PRO_BUILD_IKPMP3 = false
-- read settings from command line or environment variables
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment