|
OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
|
Classes | |
| class | Run |
Functions | |
| gametype (test) | |
| read_audio (path) | |
| rms (samples) | |
| windows (samples, rate) | |
| events (win) | |
| main () | |
Variables | |
| ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| int | FPS = 20 |
| int | MENU_FRAMES = 500 |
| int | TIMEOUT = 150 |
| int | BOTS_TIMEOUT = 300 |
| int | MIN_RMS = 100 |
| int | DOMINANCE = 3 |
| float | WINDOW = 0.05 |
| float | GAP = 1.0 |
| str | LOCAL_ALIAS = 'weap_kar98k_fire_plr' |
| str | WORLD_ALIAS = 'weap_kar98k_fire' |
| str | START |
| str | LOCAL |
| str | LEFT_RIGHT |
| str | NOISE |
| tuple | CASES = ('menu_music', 'local_2d', 'left_right', 'map_change', 'no_device', 'snd_khz_22', 'callback_cost') |
A client plays sound: what it sends to the device, read from SDL's disk driver.
python3 scripts/sound_test.py /path/to/CoD2 --protocol {115|118} [--binary PATH] [--wine CMD] [--cases a,b] [--keep DIR]
Each case starts a client (cod2_linux) with SDL_AUDIODRIVER=disk, so that its
output lands in a file as the device would get it, and measures that file.
menu_music: the menu's MP3 stream has an RMS over MIN_RMS. local_2d: a
playLocalSound rises above the silence before it. left_right: a script_origin
to the player's left and then to the right, with playSound: the channel on that
side dominates by at least DOMINANCE. map_change: map_restart, vid_restart,
disconnect and quit with sounds playing leave no crash report. no_device:
SDL_AUDIODRIVER=nonexistent reaches the menu with the failure in its log and no
crash. snd_khz_22: the menu's music at 22 kHz. callback_cost: bots fighting on a
local game (scripts/install_bots.py), the worst callback snd_stats prints is
below half the buffer. Exits with 0 when every case passes. --wine runs a
Windows client (cod2_win32.exe, given with --binary) with that command. --keep copies each case's log and
audio to DIR. The client opens a window and needs a CD key in
~/.cod2/preferences; without one the test is skipped (exit 0).
| sound_test.events | ( | win | ) |
The (left, right) energy of each burst, split by GAP of quiet.
| sound_test.gametype | ( | test | ) |
fx_test's gametype, whose player starts test as it spawns.
| sound_test.main | ( | ) |
| sound_test.read_audio | ( | path | ) |
The interleaved 16 bit samples of a disk driver file, or an empty array.
| sound_test.rms | ( | samples | ) |
| sound_test.windows | ( | samples, | |
| rate ) |
(left RMS, right RMS) of each WINDOW of stereo samples.
| int sound_test.BOTS_TIMEOUT = 300 |
| tuple sound_test.CASES = ('menu_music', 'local_2d', 'left_right', 'map_change', 'no_device', 'snd_khz_22', 'callback_cost') |
| int sound_test.DOMINANCE = 3 |
| int sound_test.FPS = 20 |
| float sound_test.GAP = 1.0 |
| str sound_test.LEFT_RIGHT |
| str sound_test.LOCAL |
| str sound_test.LOCAL_ALIAS = 'weap_kar98k_fire_plr' |
| int sound_test.MENU_FRAMES = 500 |
| int sound_test.MIN_RMS = 100 |
| str sound_test.NOISE |
| sound_test.ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| str sound_test.START |
| int sound_test.TIMEOUT = 150 |
| float sound_test.WINDOW = 0.05 |
| str sound_test.WORLD_ALIAS = 'weap_kar98k_fire' |