This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, January 19, 2012 11:18:21 AM(UTC)
Groups: Registered
Posts: 8
I am currently working on a project that analyzes the audio of an MP4 to detect "clicks" in the audio and records the time of these clicks. I was able to parse a PCM WAVE file and achieve this, but with mp4 my luck wasn't as good since the audio/video signals were interleaved. Now I'm looking at using leadtools simply to convert the MP4 to PCM WAV. Any help on setting up the ltmmConvert object would be great! This is the only thing I have so far (I was able to do this easily in VB6).
<font face="Lucida Console" size="2">
IltmmConvert* m_convert;
CoInitialize( NULL );
HRESULT hr;
hr = CoCreateInstance(CLSID_ltmmConvert, NULL, CLSCTX_INPROC_SERVER, IID_IltmmConvert, (void**) &m_convert);
_bstr_t bstrt( argv[1] );
m_convert->put_SourceFile( bstrt );
bstrt = argv[2];
m_convert->put_TargetFile( bstrt );
m_convert->put_AllowedStreams( ltmmConvert_Stream_Audio );
m_convert->put_TargetFormat( ltmmConvert_TargetFormat_WAVE );
//m_convert->put_TargetType(8); PCM identifier = 8 but this is not correct way to do this
m_convert->StartConvert();
if(FAILED(hr))
cout << "Failed";
return 0;
</font>
This code creates a ZERO kb file wav file. I know for certain that I will always be converting MP4 to PCM WAV so I have no need to load all audio compressors, and absolutely no need for any kind of dialog. Any help is greatly appreciated.
Adam
#2
Posted
:
Friday, January 20, 2012 12:55:04 PM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
I believe the best place for you to start is this link.
http://www.leadtools.com/help/leadtools/v175/multimedia/api/dllc_/selectingltmmconvertobjectcompressorsexc++.htm
It shows how the video/audio compressors as supposed to be selected. You will want to make sure your PCR compressor is selected, then it should be fine.
The example may have a lot of parts making this example over complicated, just focus on the functions:
g_pConvert->get_AudioCompressors
pCompressors->put_Selection
pCompressors->Find
Those three and the example, I believe will be enough to get you started at least.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.