Print Audio Types Example for C++

HRESULT PrintAudioTypes(IltmsAudioTypes* audiotypes) 
{ 
   HRESULT hr; 
   // print the audio types to stdout 
   _tprintf(_T("--- Audio Types ---\n\n")); 
   long count; 
   hr = audiotypes->get_Count(&count); 
   for(long index = 0; index < count; index++) 
   { 
      CComPtr audiotype; 
      hr = audiotypes->Item(index, &audiotype); 
      if(FAILED(hr)) 
         goto error; 
      hr = PrintAudioType(audiotype); 
      if(FAILED(hr)) 
         goto error; 
   } 
error: 
   _tprintf(_T("\n")); 
   return hr; 
} 
HRESULT PrintLiveStreamAudioTypes(IltmsLiveStream* stream) 
{ 
   HRESULT hr; 
   // print the stream audio types to stdout 
   _tprintf(_T("--- Live Stream Audio Types ---\n\n")); 
   { 
      CComPtr audiotypes; 
      hr = stream->get_AudioTypes(&audiotypes); 
      if(FAILED(hr)) 
         goto error; 
      hr = PrintAudioTypes(audiotypes); 
      if(FAILED(hr)) 
         goto error; 
   } 
error: 
   _tprintf(_T("\n")); 
   return hr; 
} 
HRESULT PrintAvailableAudioTypes(IltmsServer* server) 
{ 
   HRESULT hr; 
   CComPtr streams; 
   CComPtr stream; 
   // create live stream just to enumerate the audio types 
   hr = server->GetLiveStreams(&streams); 
   if(FAILED(hr)) 
      goto error; 
   hr = streams->CreateLiveStream(&stream); 
   if(FAILED(hr)) 
      goto error; 
   hr = PrintLiveStreamAudioTypes(stream); 
   if(FAILED(hr)) 
      goto error; 
error: 
   return hr; 
} 

Help Version 19.0.2017.10.19
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Media Streaming C API Help