Option for Unprocessed Mic Audio
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "audio.h"
|
||||
|
||||
#include "application.h"
|
||||
#include "utils/named_thread.h"
|
||||
#include "wivrn_client.h"
|
||||
#include "xr/instance.h"
|
||||
@@ -157,6 +158,10 @@ void wivrn::android::audio::build_microphone(AAudioStreamBuilder * builder, int3
|
||||
AAudioStreamBuilder_setPerformanceMode(builder, AAUDIO_PERFORMANCE_MODE_LOW_LATENCY);
|
||||
AAudioStreamBuilder_setSharingMode(builder, AAUDIO_SHARING_MODE_EXCLUSIVE);
|
||||
AAudioStreamBuilder_setFormat(builder, AAUDIO_FORMAT_PCM_I16);
|
||||
if (application::get_config().mic_unprocessed_audio)
|
||||
{
|
||||
AAudioStreamBuilder_setInputPreset(builder, AAUDIO_INPUT_PRESET_UNPROCESSED);
|
||||
}
|
||||
|
||||
AAudioStreamBuilder_setDataCallback(builder, µphone_data_cb, this);
|
||||
AAudioStreamBuilder_setErrorCallback(builder, µphone_error_cb, this);
|
||||
|
||||
@@ -188,6 +188,9 @@ configuration::configuration(xr::system & system)
|
||||
if (auto val = root["passthrough_enabled"]; val.is_bool())
|
||||
passthrough_enabled = val.get_bool();
|
||||
|
||||
if (auto val = root["mic_unprocessed_audio"]; val.is_bool())
|
||||
mic_unprocessed_audio = val.get_bool();
|
||||
|
||||
if (auto val = root["virtual_keyboard_layout"]; val.is_string())
|
||||
virtual_keyboard_layout = val.get_string().value();
|
||||
|
||||
@@ -252,6 +255,7 @@ void configuration::save()
|
||||
json << ",\"preferred_refresh_rate\":" << preferred_refresh_rate;
|
||||
json << ",\"resolution_scale\":" << resolution_scale;
|
||||
json << ",\"passthrough_enabled\":" << std::boolalpha << passthrough_enabled;
|
||||
json << ",\"mic_unprocessed_audio\":" << std::boolalpha << mic_unprocessed_audio;
|
||||
for (auto & [key, value]: features)
|
||||
json << "," << key << ":" << std::boolalpha << value;
|
||||
json << ",\"virtual_keyboard_layout\":" << json_string(virtual_keyboard_layout);
|
||||
|
||||
@@ -49,6 +49,7 @@ public:
|
||||
float resolution_scale = 1.4;
|
||||
bool show_performance_metrics = false;
|
||||
bool passthrough_enabled = false;
|
||||
bool mic_unprocessed_audio = false;
|
||||
|
||||
std::string virtual_keyboard_layout = "QWERTY";
|
||||
|
||||
|
||||
@@ -636,6 +636,17 @@ void scenes::lobby::gui_settings()
|
||||
}
|
||||
vibrate_on_hover();
|
||||
}
|
||||
{
|
||||
ImGui::BeginDisabled(not config.check_feature(feature::microphone));
|
||||
if (ImGui::Checkbox(_S("Unprocessed Microphone Audio"), &config.mic_unprocessed_audio))
|
||||
{
|
||||
config.save();
|
||||
}
|
||||
vibrate_on_hover();
|
||||
if (ImGui::IsItemHovered())
|
||||
tooltip(_("Force disable audio filters, such as noise cancellation"));
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
{
|
||||
ImGui::BeginDisabled(not application::get_hand_tracking_supported());
|
||||
bool enabled = config.check_feature(feature::hand_tracking);
|
||||
|
||||
Reference in New Issue
Block a user