View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006491 | The Dark Mod | Sound System | public | 18.02.2024 10:03 | 15.06.2024 13:48 |
Reporter | stgatilov | Assigned To | stgatilov | ||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Product Version | TDM 2.12 | ||||
Target Version | TDM 2.13 | Fixed in Version | TDM 2.13 | ||
Summary | 0006491: Estimate current volume of played sound for subtitles | ||||
Description | Volume of played sound is a sum of volume modifier (gain) and volume of sound sample data. For the purpose of volume display in subtitles, we only use gain right now. We should add some way to track sound sample amplitude, preferably max over some duration (a second maybe). When it is done, add a volume lower bound for when to display subtitle. Right now subtitles are often visible when they are inaudible quiet. | ||||
Steps To Reproduce | The guards dialog in New Job is a good example where subtitles volume value is wrong. The heard volume is the same for both guards, but the volume indicator is very different. | ||||
Tags | No tags attached. | ||||
Committed: r10800 Estimate current sound sample volume for each channel, use it to set subtitles alpha. The average sample magnitude was easy to track: I simply use streamed sample data at the moment when it is pushed into OpenAL. It goes there in blocks of 4096 samples (44100 samples per second). I compute maximum magnitude in a block, and maintain "exponential moving average" over these values. There are three tdm_subtitles_volumeXyz cvars which affect how the raw volume is used. The idea is that: alpha = 0 at volume <= Min alpha = 1 at volume >= Max alpha grows logarithmically in-between Also now I hide subtitles for sounds with volume < Min. Typically volume fluctuates about 11 times per second, so if it is near Min, then subtitles can start blinking. To reduce this issue a bit, I hide a currently displayed subtitle only if its volume falls below MinDisappear. The default values are: 0.001 = tdm_subtitles_volumeMinDisappear 0.003 = tdm_subtitles_volumeMin 0.1 = tdm_subtitles_volumeMax Feels good to me =) |
|
Date Modified | Username | Field | Change |
---|---|---|---|
18.02.2024 10:03 | stgatilov | New Issue | |
15.06.2024 13:48 | stgatilov | Note Added: 0016741 | |
15.06.2024 13:48 | stgatilov | Assigned To | => stgatilov |
15.06.2024 13:48 | stgatilov | Status | new => resolved |
15.06.2024 13:48 | stgatilov | Resolution | open => fixed |
15.06.2024 13:48 | stgatilov | Fixed in Version | => TDM 2.13 |