ffmpeg silencedetect does not trim pauses when room tone is near threshold
A recording contains audible pauses (1.5s or longer) that should be trimmed down to 0.5s in the playback rendition, but they stay at full length. The silence gate logic uses ffmpeg's silencedetect filter to find stretches below a fixed threshold (−50 dBFS) and trims them. The expected behavior is that even short pauses would be detected and cut. Instead, the pause audio stays untouched.
The issue occurs when the recording's background room tone (the quietest, most consistent level in the recording) happens to sit near or at the detection threshold. In those cases, ffmpeg's silencedetect never marks the pauses as below-threshold, because the pauses are just the room tone itself—they don't cross the fixed boundary. The pauses are audibly different from speech (lower energy, different character) but electronically indistinguishable from the room tone floor.
The silence detection uses an absolute threshold (−50 dBFS) that does not adapt to the recording's actual noise floor. When room tone sits at or above that threshold, pauses that are still quieter than the threshold fail to be detected as silence because they're too close to the room tone floor.
The fix measures the room tone floor (the 10th percentile of frame levels across the recording) and sets the pause detection threshold relative to it: floor + PAUSE_OVER_FLOOR_DB, capped at ONSET_BELOW_PEAK_DB below the loudest frame. This way, pauses dip below the room tone and cross the adaptive threshold, so they're detected and cut consistently, regardless of absolute recording level. Before: aselect='threshold > -50dBFS' on every frame. After: compute floor_db = percentile(frames, 10), set threshold = floor_db + offset_db, detect against that.
The cut is computed once per recording at upload via room_tone_spans() and the same result is used for both STT silence gating and playback pause trimming (trimmed to 0.5s per pause on playback, left intact for STT at −50 dBFS to avoid inventing speech).