Playing a sound via configstrings

Is it possible to play a sound via setting a configstring? Eg:

SV_SetConfigstring( CS_SOUNDS, “sound/world/klaxon1.wav” );

The above code returns the following error in console:

Unknown extension for sound/world/klaxon1.wav
WARNING: could not find sound/world/klaxon1.wav - using default

No. CS_SOUNDS+0 to CS_SOUNDS+255 configstrings only tell cgame the name of the sound to play, not when to play it.

FWIW, you would use CS_SOUNDS+255, not “255: sound/world/klaxon1.wav” like you said on IRC. (Well, you actually said 288, but that is invalid as it’s more than 255.)

There are game event entities that cause cgame to play a sound from CS_SOUNDS+0 to 255. I don’t know how you’d do it in server right off hand. It would require massive hacks and must know game-only information like the entity_event_t enum (which OSP may of changed). This probably isn’t a simple thing that you can get someone to tell you how to do.

1 Like

Zturtleman, thanks for your detailed response. I’ll check playing sounds off of my to-do list then!