X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=blobdiff_plain;f=nucleus%2Ftools%2Fsimple_utilities%2Fplaysound.cpp;fp=nucleus%2Ftools%2Fsimple_utilities%2Fplaysound.cpp;h=76b4b1d4bd267cf3a6a69440dd742d24b2977b5a;hp=d8fe12b1300415160b2c25f404551c2e6539f3cf;hb=de0da7f2f7958d4ba652ff2ef5c79991700141ac;hpb=a4c99c6006b3aa20b5f65f02c2d30db7e790083a diff --git a/nucleus/tools/simple_utilities/playsound.cpp b/nucleus/tools/simple_utilities/playsound.cpp index d8fe12b1..76b4b1d4 100644 --- a/nucleus/tools/simple_utilities/playsound.cpp +++ b/nucleus/tools/simple_utilities/playsound.cpp @@ -26,7 +26,7 @@ #include #include -#ifdef _MSC_VER +#ifdef __WIN32__ #include #endif @@ -47,12 +47,17 @@ int main(int argc, char *argv[]) return 12; } for (int i = 1; i < argc; i++) { -// out.log(astring(astring::SPRINTF, "soundfile %d: %s", i, argv[i])); -#ifdef _MSC_VER - if (!PlaySound(to_unicode_temp(argv[i]), NULL_POINTER, SND_FILENAME)) - out.log(astring("failed to play ") + argv[i], ALWAYS_PRINT); + astring sound_file = argv[i]; +out.log(a_sprintf("soundfile %d: %s", i, sound_file.s()), ALWAYS_PRINT); + if (sound_file.ends(".mp3")) { + out.log(astring("skipping MP3 file ") + sound_file, ALWAYS_PRINT); + continue; + } +#ifdef __WIN32__ + if (!PlaySound(to_unicode_temp(sound_file), NULL_POINTER, SND_FILENAME)) + out.log(astring("failed to play ") + sound_file, ALWAYS_PRINT); #else - out.log(astring("this program is a NO-OP, ignoring ") + argv[i], ALWAYS_PRINT); + out.log(astring("this program is a NO-OP, ignoring ") + sound_file, ALWAYS_PRINT); #endif } return 0;