cfsndserv — crossfire client sound server
Descriptiongetzone adjusts and mixes sounds before playing them
Usagegetzone none - started automatically by crossfire client
Configuration options~/.crossfire/sndconfig can contain the following options:
- 1 means stereo sound, 0 - mono
- bitrate of generated sound - 8 or 16
- if we should sent signed data to the soundcard. 1 means yes.
- speed of playing data. This should be 11025, or sound pitch will change
- how many buffers to allocate
- how big the buffers should be. buffers*buflen shouldn't be smaller than the longest sound to be played.
- home many sound can be played at the same time. When this setting is bigger, each sound volume will decrease.
How does it work?The sound server gets information about sounds to be played on standard input.
The information is a line: <sound number> <sound type> <relative x> <relative y> All those numbers are hex. The file ~/.crossfire/sounds contains description of sound numbers and types. For example:
3 0 5 0
Means that normal sound SOUND_FUMBLE spell should be played as it's source was5 units to the right of player.
Sounds are mixed in special buffers, which are in fact one buffer, which should be big enough for the biggest sound to be played.
The buffers, if contain anything, are sent one by one to the sound device. Each buffer is cleaned after playing.
Sounds data is multiplied by some ratio (<1) evaluated from it's position and volume and added to the buffers, starting from the next after the one being played.
So bigger buffer means bigger delay, before th sound is actually played, but the smaller buffer is, the bigger is possibility, we won't succeed filling the next buffer, before last is played.