Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, January 19, 2012 11:18:21 AM(UTC)
AdamBrown

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**) &amp;m_convert);

_bstr_t bstrt( argv[1] );
m_convert-&gt;put_SourceFile( bstrt );

bstrt = argv[2];
m_convert-&gt;put_TargetFile( bstrt );

m_convert-&gt;put_AllowedStreams( ltmmConvert_Stream_Audio );
m_convert-&gt;put_TargetFormat( ltmmConvert_TargetFormat_WAVE );

//m_convert-&gt;put_TargetType(8); PCM identifier = 8 but this is not correct way to do this

m_convert-&gt;StartConvert();

if(FAILED(hr))
cout &lt;&lt; &quot;Failed&quot;;
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
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Friday, January 20, 2012 12:55:04 PM(UTC)

Danny H  
Guest

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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.073 seconds.