Hi,<o:p></o:p>
My computer has two audio drivers. One is High Definition Audio,and another is NVidia High Definition Audio.<o:p></o:p>
The Device Manger is like this .
High Definition Audio.
NVIDA High Definition Audio.
When I use DeviceInformation::FindAllAsync(DeviceClass) like this code
block.
DeviceClass dataFlow;
if ( SPEECH_MODE_PLAYBACK == nMode )
{
dataFlow = DeviceClass::AudioRender;
}
else
{
dataFlow = DeviceClass::AudioCapture;
}
auto findAllOp = DeviceInformation::FindAllAsync( dataFlow );
HANDLE hTmp = CreateEventExW( NULL, NULL, 0, EVENT_MODIFY_STATE | SYNCHRONIZE );
for ( ;; )
{
if ( Windows::Foundation::AsyncStatus::Completed == findAllOp->Status )
{
break;
}
WaitForSingleObjectEx( hTmp, 100, FALSE );
}
CloseHandle( hTmp );
auto findOp = findAllOp->GetResults();
unsigned int nDevices = findOp->Size;
if ( nDevices < 1 )
{
DebugPrint( _T("[Error][Initialize]: No Available Device!\n") );
return -1;
}
When the dataFlow equal DeviceClass::AudioRender,I get the a value 1 for nDevice.Because I have only one headphones.But when I
disable the NVIDA High Definition Audio ,I get the value is 0.So my program will crash in the next statement. However, I comment out this if branch.My program will run well. Because I can still
get the default device.Of course,I do not use the FindAllAsync method.
So I suspect that this method(FindAllAsync) has a problem.