Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
martonp96 committed Aug 15, 2023
1 parent d56d047 commit 27329e8
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions examples/devicetests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,20 @@ int main()

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

if(cmd == "devices")
if (nextDeviceIndex < inputDevices.size())
{
numDevices = soundInput->GetNumDevices();
printf("number of input devices: %d\n", numDevices);

for (int i = 0; i < numDevices; i++)
auto err = soundInput->SelectDeviceByUID(inputDevices[nextDeviceIndex].c_str());
if (err != AltVoiceError::Ok)
{
const int deviceId = soundInput->GetDeviceIdFromIndex(i);
inputDevices.push_back(soundInput->GetDeviceUID(deviceId));
printf("%d: %s[%s]\n", i, soundInput->GetDeviceName(deviceId), soundInput->GetDeviceUID(deviceId));
std::cout << AV_GetVoiceErrorText(err) << std::endl;
}
else
{
std::cout << soundInput->GetCurrentDeviceUID() << std::endl;
}
}
else if(cmd == "device")
{
auto device = soundInput->GetCurrentDeviceUID();
printf("current device: %s", device);
soundInput->UpdateDevice();
}
}
}

0 comments on commit 27329e8

Please sign in to comment.