Mercurial > pidgin.yaz
diff src/sound.c @ 3284:7b867d79da96
[gaim-migrate @ 3302]
Lex Spoon--perhaps the coolest name I've ever seen submit a patch (it's
between him and Chris Blizzard) made it so commands can play sounds!
Brilliant!
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Fri, 31 May 2002 02:26:53 +0000 |
parents | 86fdd015f40e |
children | 3a05fcb133c4 |
line wrap: on
line diff
--- a/src/sound.c Fri May 31 02:00:41 2002 +0000 +++ b/src/sound.c Fri May 31 02:26:53 2002 +0000 @@ -481,7 +481,19 @@ } else if ((sound_options & OPT_SOUND_CMD) && sound_cmd[0]) { - debug_printf("can't play internal sound with external command -- skipping\n"); + char command[4096]; + FILE *child; + + g_snprintf(command, sizeof(command), sound_cmd, "-"); + + child=popen(command, "w"); + if(child == NULL) { + perror("popen"); + return; + } + + fwrite(data, size, 1, child); + pclose(child); return; }