mirror of
https://github.com/uowuo/abaddon.git
synced 2026-08-15 05:19:58 +00:00
make vad method a setting and tie it to combobox
This commit is contained in:
1 parent
203e566919
commit
60e3f73324
6 files changed
+44
-18
No files matched your search
+18
-6
@@ -83,12 +83,6 @@ AudioManager::AudioManager() {
|
||||
|
||||
Enumerate();
|
||||
|
||||
#ifdef WITH_RNNOISE
|
||||
SetVADMethod(VADMethod::RNNoise);
|
||||
#else
|
||||
SetVADMethod(VADMethod::Gate);
|
||||
#endif
|
||||
|
||||
m_playback_config = ma_device_config_init(ma_device_type_playback);
|
||||
m_playback_config.playback.format = ma_format_f32;
|
||||
m_playback_config.playback.channels = 2;
|
||||
@@ -540,7 +534,25 @@ uint32_t AudioManager::GetRTPTimestamp() const noexcept {
|
||||
return m_rtp_timestamp;
|
||||
}
|
||||
|
||||
void AudioManager::SetVADMethod(const std::string &method) {
|
||||
spdlog::get("audio")->debug("Setting VAD method to {}", method);
|
||||
if (method == "gate") {
|
||||
SetVADMethod(VADMethod::Gate);
|
||||
} else if (method == "rnnoise") {
|
||||
#ifdef WITH_RNNOISE
|
||||
SetVADMethod(VADMethod::RNNoise);
|
||||
#else
|
||||
SetVADMethod(VADMethod::Gate);
|
||||
spdlog::get("audio")->error("Tried to set RNNoise VAD method with support disabled");
|
||||
#endif
|
||||
} else {
|
||||
SetVADMethod(VADMethod::Gate);
|
||||
spdlog::get("audio")->error("Tried to set unknown VAD method {}", method);
|
||||
}
|
||||
}
|
||||
|
||||
void AudioManager::SetVADMethod(VADMethod method) {
|
||||
spdlog::get("audio")->debug("Setting VAD method to enum {}", static_cast<int>(method));
|
||||
m_vad_method = method;
|
||||
|
||||
#ifdef WITH_RNNOISE
|
||||
|
||||
Reference in new issue
Block a user