mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 14:01:49 +00:00
fix audio input device
This commit is contained in:
parent
b2ed4b472f
commit
0185ef6816
1 changed files with 9 additions and 1 deletions
|
|
@ -173,6 +173,12 @@ void audio::initialize(
|
||||||
logger.info() << "initializing NoAudio backend";
|
logger.info() << "initializing NoAudio backend";
|
||||||
backend = NoAudio::create().release();
|
backend = NoAudio::create().release();
|
||||||
}
|
}
|
||||||
|
if (settings.inputDevice.get() == "auto") {
|
||||||
|
auto inputDevices = audio::get_input_devices_names();
|
||||||
|
if (!inputDevices.empty()) {
|
||||||
|
settings.inputDevice.set(inputDevices.at(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
struct {
|
struct {
|
||||||
std::string name;
|
std::string name;
|
||||||
NumberSetting* setting;
|
NumberSetting* setting;
|
||||||
|
|
@ -210,7 +216,9 @@ void audio::initialize(
|
||||||
::input_device = backend->openInputDevice(
|
::input_device = backend->openInputDevice(
|
||||||
settings.inputDevice.get(), 44100, 1, 16
|
settings.inputDevice.get(), 44100, 1, 16
|
||||||
);
|
);
|
||||||
::input_device->startCapture();
|
if (::input_device != nullptr) {
|
||||||
|
::input_device->startCapture();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (::input_device) {
|
if (::input_device) {
|
||||||
::input_device->stopCapture();
|
::input_device->stopCapture();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue