Sound for Mac?
Posted: Thursday, 31st March 2011, 22:29
Is there any way to turn sound on for Mac Tiles? I've never heard a peep.
tcjsavannah wrote:The only sound I ever hear is the groan I utter when another character bites the dust.
galehar wrote:There's no sound effect in crawl. On any platform.
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.
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
}