main: Reset gains to 0dB on startup

This is mostly to avoid a sudden jump up in volume on the common case where the
first sound happens after enough catchup has occurred (once we implement
catchup...)

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2023-10-12 16:52:37 +09:00
parent 3660fd85d8
commit 5c1fd2b60b

View file

@ -162,6 +162,11 @@ fn main() {
unlock_elem.write_int(&ctl, UNLOCK_MAGIC);
for (idx, group) in groups.iter_mut() {
group.speakers.iter_mut().for_each(|s| s.update(&ctl, 0.0));
group.gain = 0.0;
}
loop {
// Block while we're reading into the buffer
io.readi(&mut buf).unwrap();