IltmmAudioInputs::put_Enable Example for C++

void EnableAudioInput(IltmmAudioInputs *pAudioInputs) 
{ 
   VARIANT_BOOL bEnable; 
   long lCount; 
 
   // Disable all inputs: 
   pAudioInputs->put_Enable(VARIANT_FALSE); 
 
    // Now enable the first input: 
   pAudioInputs->get_Count(&lCount);  
   if (lCount > 0) 
   { 
      IltmmAudioInput *pAudioInput = NULL;  
      HRESULT hr = pAudioInputs->Item(0, &pAudioInput);  
      if (SUCCEEDED(hr) && pAudioInput)  
      { 
         pAudioInput->put_Enable(VARIANT_TRUE); 
      } 
      pAudioInput->Release(); 
   } 
 
   // Check if the input is enabled: 
   pAudioInputs->get_Enable(&bEnable); 
   if (bEnable == VARIANT_TRUE) 
      AfxMessageBox(TEXT("An input is enabled")); 
   else 
      AfxMessageBox(TEXT("All inputs are disabled")); 
} 
Help Version 20.0.2019.9.19
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Multimedia C API Help