pub enum StreamMode {
PollingShared {
autoconvert: bool,
buffer_duration_hns: i64,
},
PollingExclusive {
buffer_duration_hns: i64,
period_hns: i64,
},
EventsShared {
autoconvert: bool,
buffer_duration_hns: i64,
},
EventsExclusive {
period_hns: i64,
},
}Expand description
Helper enum for initializing an AudioClient. There are four main modes that can be specified, corresponding to the four possible combinations of sharing mode and timing. The enum variants only expose the parameters that can be set in each mode.
See the documentation of AudioClient::initialize_client() for a description of the sharing and timing modes, and how to choose between them.
Variants§
Shared mode using polling for timing. The parameters that can be set are the device buffer duration (in units on 100 ns) and whether automatic format conversion should be enabled. The audio engine decides the period, and this cannot be changed.
PollingExclusive
Exclusive mode using polling for timing. Both device period and buffer duration are given, in units of 100 ns.
Shared mode using event driven timing. The parameters that can be set are the device buffer duration (in units on 100 ns) and whether automatic format conversion should be enabled. The audio engine decides the period, and this cannot be changed.
EventsExclusive
Exclusive mode using event driven timing. The period and buffer duration must be set to the same value. Only device period is given here, in units of 100 ns.