summary refs log tree commit diff stats
path: root/src/common/text.c
diff options
context:
space:
mode:
authorArnavion <arnavion@gmail.com>2014-09-13 00:23:44 -0700
committerArnavion <arnavion@gmail.com>2014-09-13 00:23:44 -0700
commite209e55e5921e9ccaf1f713aa5010ddf1cb1c2d8 (patch)
tree615c190bbf1f166e8835364213a61de9b021efdf /src/common/text.c
parentad2300f2365e4499fb559c80a6c313d82e8c36d6 (diff)
Use PlaySoundW to play sounds on Windows.
Fixes #1133
Diffstat (limited to 'src/common/text.c')
-rw-r--r--src/common/text.c9
1 files changed, 8 insertions, 1 deletions
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)