fix audio latency

This commit is contained in:
csf
2022-05-19 18:39:13 +08:00
parent 31a40538dc
commit a071eeb710
4 changed files with 58 additions and 5 deletions

View File

@@ -348,6 +348,7 @@ fn send_f32(data: &[f32], encoder: &mut Encoder, sp: &GenericService) {
let mut msg_out = Message::new();
msg_out.set_audio_frame(AudioFrame {
data,
timestamp: crate::common::get_time(),
..Default::default()
});
sp.send(msg_out);
@@ -367,10 +368,11 @@ fn send_f32(data: &[f32], encoder: &mut Encoder, sp: &GenericService) {
let mut msg_out = Message::new();
msg_out.set_audio_frame(AudioFrame {
data,
timestamp: crate::common::get_time(),
..Default::default()
});
sp.send(msg_out);
}
Err(_) => {}
}
}
}