comparison 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
comparison
equal deleted inserted replaced
3283:f4f4232f4e83 3284:7b867d79da96
479 gdk_beep(); 479 gdk_beep();
480 return; 480 return;
481 } 481 }
482 482
483 else if ((sound_options & OPT_SOUND_CMD) && sound_cmd[0]) { 483 else if ((sound_options & OPT_SOUND_CMD) && sound_cmd[0]) {
484 debug_printf("can't play internal sound with external command -- skipping\n"); 484 char command[4096];
485 FILE *child;
486
487 g_snprintf(command, sizeof(command), sound_cmd, "-");
488
489 child=popen(command, "w");
490 if(child == NULL) {
491 perror("popen");
492 return;
493 }
494
495 fwrite(data, size, 1, child);
496 pclose(child);
485 return; 497 return;
486 } 498 }
487 499
488 pid = fork(); 500 pid = fork();
489 501