Skip to content

Commit

Permalink
Test app changes
Browse files Browse the repository at this point in the history
  • Loading branch information
emcifuntik committed Oct 26, 2023
1 parent c518b0d commit 3aae1d7
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions examples/devicetests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,43 @@ int main()

//AV_DestroySoundInput(soundInput);

bool noiseSuppression = true;
bool normalizationEnabled = true;

for(;;)
{
int nextDeviceIndex = 0;
std::cin >> nextDeviceIndex;
std::string input;
std::cin >> input;

if (nextDeviceIndex < inputDevices.size())
if (input == "n")
{
noiseSuppression = !noiseSuppression;
soundInput->SetNoiseSuppressionEnabled(noiseSuppression);
}
else if (input == "o")
{
auto err = soundInput->SelectDeviceByUID(inputDevices[nextDeviceIndex].c_str());
if (err != AltVoiceError::Ok)
{
std::cout << AV_GetVoiceErrorText(err) << std::endl;
normalizationEnabled = !normalizationEnabled;
soundInput->SetNormalizatonEnabled(normalizationEnabled);
}
else {
try {
nextDeviceIndex = std::stoi(input);
if (nextDeviceIndex < inputDevices.size())
{
auto err = soundInput->SelectDeviceByUID(inputDevices[nextDeviceIndex].c_str());
if (err != AltVoiceError::Ok)
{
std::cout << AV_GetVoiceErrorText(err) << std::endl;
}
else
{
std::cout << soundInput->GetCurrentDeviceUID() << std::endl;
}
}
}
else
{
std::cout << soundInput->GetCurrentDeviceUID() << std::endl;
catch(...) {
std::cout << "Unknown argument. Possible: n, o, [number]" << std::endl;
}
}
}
Expand Down

0 comments on commit 3aae1d7

Please sign in to comment.