From e209e55e5921e9ccaf1f713aa5010ddf1cb1c2d8 Mon Sep 17 00:00:00 2001 From: Arnavion Date: Sat, 13 Sep 2014 00:23:44 -0700 Subject: Use PlaySoundW to play sounds on Windows. Fixes #1133 --- src/common/text.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/text.c b/src/common/text.c index 22467c99..329ef37b 100644 --- a/src/common/text.c +++ b/src/common/text.c @@ -2300,7 +2300,14 @@ sound_play (const char *file, gboolean quiet) if (g_access (wavfile, R_OK) == 0) { #ifdef WIN32 - PlaySound (wavfile, NULL, SND_NODEFAULT|SND_FILENAME|SND_ASYNC); + gunichar2 *wavfile_utf16 = g_utf8_to_utf16 (wavfile, -1, NULL, NULL, NULL); + + if (wavfile_utf16 != NULL) + { + PlaySoundW (wavfile_utf16, NULL, SND_NODEFAULT | SND_FILENAME | SND_ASYNC); + + g_free (wavfile_utf16); + } #else #ifdef USE_LIBCANBERRA if (ca_con == NULL) -- cgit 1.4.1