#include <stdio.h> //printf とかで必要 #include <wmsdk.h> //HRESULT とかで必要 using namespace System;//Console::ReadLine()で必要 #pragma comment(lib, "wmvcore.lib") //IWMMetadataEditor とかで必要 void main(){ HRESULT hr = S_OK; IWMMetadataEditor * pEditor = NULL; IWMHeaderInfo3 * pHeaderInfo = NULL; WORD stream = 0; WMT_ATTR_DATATYPE enumType; QWORD duration; WORD cbLength = sizeof( duration ); hr = WMCreateEditor(&pEditor); hr = pEditor->Open(L"G:\\sampleMovie\\Amanda.wma"); hr = pEditor->QueryInterface(IID_IWMHeaderInfo, (void**) &pHeaderInfo); hr = pHeaderInfo->GetAttributeByName( &stream, g_wszWMDuration, &enumType,(BYTE *)&duration, &cbLength ); printf("%d ミリ秒\r\n", (long) (duration / 10000) ); Console::ReadLine();//入力待-ウインドウ維持 }
4分6秒は246秒
0 件のコメント:
コメントを投稿