Page 1 of 1

Sound for Mac?

PostPosted: Thursday, 31st March 2011, 22:29
by ohmi
Is there any way to turn sound on for Mac Tiles? I've never heard a peep.

Re: Sound for Mac?

PostPosted: Thursday, 31st March 2011, 23:20
by galehar
There's no sound effect in crawl. On any platform.

Re: Sound for Mac?

PostPosted: Friday, 1st April 2011, 02:07
by tcjsavannah
The only sound I ever hear is the groan I utter when another character bites the dust.

Re: Sound for Mac?

PostPosted: Friday, 1st April 2011, 03:20
by smock
tcjsavannah wrote:The only sound I ever hear is the groan I utter when another character bites the dust.


This is a good reason for incubi and succubi.

Re: Sound for Mac?

PostPosted: Friday, 1st April 2011, 13:12
by jpeg
galehar wrote:There's no sound effect in crawl. On any platform.

That is not quite true. There is, after all, the corresponding option:
  Code:
sound = <regex>:<path to sound file>
        Plays the sound file if a message contains regex. The regex
        should not include commas or colons. For example
             sound = LOW HITPOINT WARNING:sound\sounds2\danger3.wav
        Getting appropriate sound files may be difficult. Check other
        roguelikes or old computer RPGs. Alternatively, ask for help
        in the newsgroup rec.games.roguelike.misc.

It does, however, look as if sound needs to be compiled in and even if I comment out the #ifdef check, I can't get it to do anything on Windows Tiles - but I think it's supposed to work. If it is deprecated, why are we keeping the option and corresponding code? If it does work somehow, it's system-dependent, so it's possible it couldn't currently work for Mac.

Compare
  Code:
void play_sound(const char *file)
{
#if defined(WINMM_PLAY_SOUNDS)
    // Check whether file exists, is readable, etc.?
    if (file && *file)
        sndPlaySoundW(utf8_to_16(file).c_str(), SND_ASYNC | SND_NODEFAULT);

#elif defined(SOUND_PLAY_COMMAND)
    char command[255];
    command[0] = 0;
    if (file && *file && (strlen(file) + strlen(SOUND_PLAY_COMMAND) < 255)
        && shell_safe(file))
    {
        snprintf(command, sizeof command, SOUND_PLAY_COMMAND, file);
        system(utf8_to_mb(command));
    }
#endif
}


I liked that feature in NetHack, wouldn't mind getting it to work for Crawl.