-
Notifications
You must be signed in to change notification settings - Fork 508
Expand file tree
/
Copy pathduplex.rs
More file actions
36 lines (31 loc) · 1014 Bytes
/
duplex.rs
File metadata and controls
36 lines (31 loc) · 1014 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use crate::{ChannelCount, InputStreamTimestamp, OutputStreamTimestamp, SampleRate};
// Timing information for a duplex callback, combining input and output timestamps.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct DuplexCallbackInfo {
input_timestamp: InputStreamTimestamp,
output_timestamp: OutputStreamTimestamp,
}
impl DuplexCallbackInfo {
pub fn new(
input_timestamp: InputStreamTimestamp,
output_timestamp: OutputStreamTimestamp,
) -> Self {
Self {
input_timestamp,
output_timestamp,
}
}
pub fn input_timestamp(&self) -> InputStreamTimestamp {
self.input_timestamp
}
pub fn output_timestamp(&self) -> OutputStreamTimestamp {
self.output_timestamp
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct DuplexStreamConfig {
pub input_channels: ChannelCount,
pub output_channels: ChannelCount,
pub sample_rate: SampleRate,
pub buffer_size: crate::BufferSize,
}