Done some tests with sounds playback.
I noticed that search for map background music files (set in worldspawn)
works in a different way than sound effects played by target_speaker entities. TEST with OA 0.8.8 engine and gamecode:
- If it's a
sound effect from a target_speaker entity, specifying "sound/mymap/sound1" or "sound/mymap/sound1.wav", in both cases will search for "sound/mymap/sound1.wav" and "sound/mymap/sound1.ogg". Specifying "sound/mymap/sound1.ogg", instead, would search for "sound/mymap/sound1.ogg.wav" and "sound/mymap/sound1.ogg.ogg", and
probably this is not what one wants... in theory it should search for "sound/mymap/sound1.ogg" and then for "sound/mymap/sound1.wav". I suppose this may be considered a
bug.
Uhm... maybe some mapper may already have changed his filename to .ogg.ogg or to .ogg.wav for manually workaround (instead of just omitting the extension in the editor)? In case this algorythm is updated, maybe should it continue
also checking for the double extensions, for compatibility, in case it doesn't find the "correct" ones?
- If it's a
background music specified in worldspawn entity, specifying "music/music1" will search for "music/music1.wav" and "music/music1.ogg". Specifying "music/music1.wav" will search for "music/music1.wav"
only and "music/music1.ogg" will search for "music/music1.ogg"
only. So, in 0.8.8, in case one wants to make replacements for Q3A music files, he may have to make them as .wav for maximum compatibility with existing maps.... which is not optimal, maybe, due to file sizes. NEWS: See "UPDATE" section below.
NOTES:
- Unlike background music, sound effects do
require the sound to be MONO, not stereo. Using a stereo sound in a target_speaker casuses the sound to be played at half speed and truncated. I can guess this is from Q3A, and probably it's okay this way: a sound effect is played on left or right speaker depending from its location relative to the player. Maybe the engine may just read one of the two channels, however probably one may just keep it as it is. UPDATE: this affect SDL and has been fixed in trst builds. But Stereo effects cause a different problem in OpenAl mode (always played at full volume).
- Playing a background music in a format different than 22Khz stereo causes an ugly yellow warning every time the music track re-starts. Probably a leftover message, with Q3A expecting 22Khz music. Can it be suppressed, e.g. shown with "/developer 1" only?
- I haven't tried with sounds played by entities different than
target_speaker and
worldspawn.
UPDATE: TESTED with currently available
nightly builds of Windows binaries (v. 2016-07-09) and gamecode (v. 2016-07-25):
- The only thing which seems to have changed is that now,
background music search has been
fixed: now you can set worldspawn to "music/music1", "music/music1.wav" and "music/music1.ogg" and it will search for both .wav and .ogg.
So that part can be considered FIXED. So in OA3, one should be able to create replacement for Q3A musics in .ogg format and they should be played in any map searching for them.
-- UPDATENEW: it looks like with the updated stuff, also the playing of stereo sounds in target_speaker has been
partially fixed. It's ok in SDL mode, but stereo sounds are played at full volume (even if you are far from them) in OpenAL mode.
- Other issues of target_speaker problem with specifying .ogg extension and yellow warning about music format in sdl mode, are still there.
UPDATE2: It looks like that (al least with current nighly builds), if you have
DO NOT LINK[/b]) h t t p s : / / openarena . wikia . com/wiki/OpenAL]OpenAL library installed (and its cvar enabled), behavior changes: yellow warning about music format is NOT shown and.... I NEED TO MAKE SOME MORE TESTS IN THE NEXT DAYS. This post is still valid for SDL sound.
[Continues
in this post.]