mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
minor refactor
This commit is contained in:
parent
6df27b8992
commit
001c1b430b
5 changed files with 9 additions and 11 deletions
|
|
@ -183,7 +183,7 @@ void audio::initialize(bool enabled, AudioSettings& settings) {
|
|||
}, true));
|
||||
}
|
||||
|
||||
input_device = backend->openInputDevice(nullptr, 44100, 1, 16);
|
||||
input_device = backend->openInputDevice("", 44100, 1, 16);
|
||||
if (input_device) {
|
||||
input_device->startCapture();
|
||||
}
|
||||
|
|
@ -254,7 +254,7 @@ std::unique_ptr<Stream> audio::open_stream(
|
|||
}
|
||||
|
||||
std::unique_ptr<InputDevice> audio::open_input_device(
|
||||
const char* deviceName, uint sampleRate, uint channels, uint bitsPerSample
|
||||
const std::string& deviceName, uint sampleRate, uint channels, uint bitsPerSample
|
||||
) {
|
||||
return backend->openInputDevice(
|
||||
deviceName, sampleRate, channels, bitsPerSample
|
||||
|
|
@ -270,9 +270,7 @@ std::vector<std::string> audio::get_output_devices_names() {
|
|||
}
|
||||
|
||||
void audio::set_input_device(const std::string& deviceName) {
|
||||
auto newDevice = backend->openInputDevice(
|
||||
deviceName.empty() ? nullptr : deviceName.c_str(), 44100, 1, 16
|
||||
);
|
||||
auto newDevice = backend->openInputDevice(deviceName, 44100, 1, 16);
|
||||
if (newDevice == nullptr) {
|
||||
logger.error() << "could not open input device: " << deviceName;
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue