Return Device(None) as a default i/o device (#638)
In most cases, device with index 0 is NOT the default output device - in my case it happens to be the ear speaker. Returning Device(None) there makes Oboe choose the default input/output device - everything works as expected.
This commit is contained in:
parent
223f28262a
commit
32cee3949b
1 changed files with 2 additions and 10 deletions
|
|
@ -73,21 +73,13 @@ impl HostTrait for Host {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_input_device(&self) -> Option<Self::Device> {
|
fn default_input_device(&self) -> Option<Self::Device> {
|
||||||
if let Ok(devices) = oboe::AudioDeviceInfo::request(oboe::AudioDeviceDirection::Input) {
|
|
||||||
devices.into_iter().map(|d| Device(Some(d))).next()
|
|
||||||
} else {
|
|
||||||
Some(Device(None))
|
Some(Device(None))
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn default_output_device(&self) -> Option<Self::Device> {
|
fn default_output_device(&self) -> Option<Self::Device> {
|
||||||
if let Ok(devices) = oboe::AudioDeviceInfo::request(oboe::AudioDeviceDirection::Output) {
|
|
||||||
devices.into_iter().map(|d| Device(Some(d))).next()
|
|
||||||
} else {
|
|
||||||
Some(Device(None))
|
Some(Device(None))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn buffer_size_range_for_params(
|
fn buffer_size_range_for_params(
|
||||||
is_output: bool,
|
is_output: bool,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue