Sound mod - no sounds playing


Problems running or configuring the software, commands & options, compiling, different platforms, using the interface, documentation, etc.

Dungeon Dilettante

Posts: 2

Joined: Friday, 31st January 2014, 10:51

Post Friday, 31st January 2014, 11:06

Sound mod - no sounds playing

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!
User avatar

Tomb Titivator

Posts: 793

Joined: Tuesday, 28th January 2014, 16:08

Post Saturday, 1st February 2014, 17:49

Re: Sound mod - no sounds playing

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.
If you are offended by something I've posted, just PM me. It probably wasn't intentional.

Dungeon Dilettante

Posts: 2

Joined: Friday, 31st January 2014, 10:51

Post Saturday, 1st February 2014, 18:51

Re: Sound mod - no sounds playing

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

Blades Runner

Posts: 546

Joined: Saturday, 7th May 2011, 02:43

Post Tuesday, 4th February 2014, 04:10

Re: Sound mod - no sounds playing

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.
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Tuesday, 4th February 2014, 09:01

Re: Sound mod - no sounds playing

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.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

Temple Termagant

Posts: 10

Joined: Tuesday, 11th February 2014, 00:48

Post Wednesday, 12th February 2014, 02:21

Re: Sound mod - no sounds playing

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.

Blades Runner

Posts: 546

Joined: Saturday, 7th May 2011, 02:43

Post Wednesday, 12th February 2014, 04:02

Re: Sound mod - no sounds playing

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.

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 18 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.