Page 1 of 1

Sound mod - no sounds playing

PostPosted: Friday, 31st January 2014, 11:06
by Izeo
Hi,

I'm new to crawl and I love the game already. I wanted to try the game out with sounds, not because I feel that the game NEEDs it, but I wanted to try it out. When I watched a youtube video showing Stone Soup with sounds, I noticed the sounds weren't that great however, so I actually wanted to try and work on my own library for it with more toned down, realistic sounds.

However I can't even get any sounds to play at all. The YT video said paste the entire sound code at the end of init.txt (I get it, # lines are comments, I'm a programmer), and leave the "sound" folder so that it's in the same folder as crawl.exe, so /CrawlsExeDir/sound/(the sound wavs). Tried re-installing a fresh copy of Crawl and re-installing the mod again, in case I made a mistake like deleting or overwriting something in init on accident. Moved CrawlsDir to C drive to avoid the potential problem that some games have with longer filepaths --> C:/Crawl/sound/(the sounds). Set WMP back to my default .wav player (my default sound/video player was set as VLC media player). I've opened and checked init.txt to verify that I did actually save it (so it wasn't something dumb like opening init.txt, pasting the code, leaving the notepad file open and trying to test without having saved first). Verified that the folder name called for in init.txt is the same folder name the sounds are in. i.e. the problem is not "sound" vs "sounds". The problem is not a .zip filepath/extraction error, i.e. CrawlDir/sound/sound/(the sounds). After all my attempts, there are still no sounds in-game. The sounds themselves seem to play fine if I play them individually (opened in either VLC or WMP). (Of course I have no issues related to playing sound on my computer in other ways/in other games.) What's up?

I'm running Windows XP Pro 64-bit. I can give more specs if needed but I suspect there's just some bool I need to flip or something simple.

Thanks!

Re: Sound mod - no sounds playing

PostPosted: Saturday, 1st February 2014, 17:49
by Greyr
Hey man, welcome to the community!

Lemme preface by saying I have no clue how to help you. If the YouTube video wasn't clear then, well.
You've heard the sounds right? I'm assuming yeah. They're literally just pew pew and the occasional you're gonna die siren. Wouldn't you prefer the stark, rich baritones of Robert Goulet? Or perhaps the chocolaty smoothness of Barry White?

That's all the help I can provide.
Again, welcome.

Re: Sound mod - no sounds playing

PostPosted: Saturday, 1st February 2014, 18:51
by Izeo
Thanks.

It's not that the YT video wasn't clear, it's just that following it exactly didn't make the sounds play in-game. I do have the most up-to-date version of Crawl and it's the offline version. Yes, I didn't necessarily like the choices of a lot of the sfx from the video. Still, I wanted to both try it out, and potentially work on my own soundset, mainly to try and take the level of "pew pew" down a couple notches with some subtler sounds instead. :)

This screenshot should be able to determine if the problem is my own user error. It shows my Crawl directory, the section at the end of my init.txt file with the sound code, the sound folder, and verifies that one highlighted sound is also in the actual folder. I promise you; no sounds in-game for me. :(
http://i.imgur.com/v6KA6Y9.png

Re: Sound mod - no sounds playing

PostPosted: Tuesday, 4th February 2014, 04:10
by savageorange
Same here, but I'm running arch linux x86_64.

If you search the options_guide.txt, you'll see that 'sound' is the only sound-related option.

This is the entire code for play_sound:

  Code:
void play_sound(const char *file)
{
#if defined(WINMM_PLAY_SOUNDS)
    // Check whether file exists, is readable, etc.?
    if (file && *file)
        sndPlaySoundW(OUTW(file), 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(OUTS(command));
    }
#elif defined(__ANDROID__)
    if (Mix_Playing(0))
        Mix_HaltChannel(0);
    if (android_sound_to_play != NULL)
        Mix_FreeChunk(android_sound_to_play);
    android_sound_to_play = Mix_LoadWAV(OUTS(file));
    Mix_PlayChannel(0, android_sound_to_play, 0);
#endif
}


So on Windows, it uses WinMM interface (which I know nothing about); On Linux(and other platforms?), it uses whatever command is specified by SOUND_PLAY_COMMAND, which should include exactly one %s where the filename should be placed. On Android it uses some Android-specific API that I'm not picking up the name of here.

EDIT: It seems that on all platforms, you need to edit AppHdr.h before compiling in order to enable sound. I suspect that most packagers do not bother to do this.

Re: Sound mod - no sounds playing

PostPosted: Tuesday, 4th February 2014, 09:01
by galehar
savageorange wrote:EDIT: It seems that on all platforms, you need to edit AppHdr.h before compiling in order to enable sound. I suspect that most packagers do not bother to do this.

Actually, if you do a native windows compile, it should support sound (see Makefile:195). I didn't test it. Also, the downloadable windows binary are cross-compiled from a Linux, but it seems it should be compiled in anyway.

Re: Sound mod - no sounds playing

PostPosted: Wednesday, 12th February 2014, 02:21
by swizzlewizzle
I'm trying to get the sound to work and from this thread so far the only solution I am seeing is... "do a native windows compile". I thought that the posted trunk builds *were* native windows compiled, no? Using those builds, I am not able to get sounds working.

Some help would be great.

Re: Sound mod - no sounds playing

PostPosted: Wednesday, 12th February 2014, 04:02
by savageorange
swizzlewizzle wrote:I'm trying to get the sound to work and from this thread so far the only solution I am seeing is... "do a native windows compile". I thought that the posted trunk builds *were* native windows compiled, no?


galehar wrote:the downloadable windows binary are cross-compiled from a Linux


That is, they are compiled FOR Windows, ON Linux. Windows itself is not involved in the compilation process.