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 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Multimedia C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.