Hint Regarding Copying ASF Files
WMPTalk.com Forum Index WMPTalk.com
Discuss Windows Media Player
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web wmptalk.com
Hint Regarding Copying ASF Files

 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> SDK
Author Message
Jason
Guest





Posted: Wed Sep 29, 2004 10:32 pm    Post subject: Hint Regarding Copying ASF Files Reply with quote

In the format SDK, the section "Copying Streams Without Decompressing the
Data" details how you can copy an ASF stream without uncompressing the
samples. I adapted this to extract an audio stream from an A/V stream. The
audio stream played properly in Windows Media Player but its length was off
(3 min instead of 2 hr). It turned out the file wasn't getting indexed. At
first, I tried creating a new index, but this took forever. It turns out
that AutoIndexing was off in the Writer (maybe because I wasn't including
the video information). I turned it on and my extracted audio files work
fine.

To turn on autoindexing, do something like the following before calling
BeginWriting.

// Make sure autoindexing is on
if(SUCCEEDED(m_pWriterAdvanced->GetSinkCount(& dwCount))) {
for(DWORD dw = 0; dw < dwCount; dw++) {
CComPtr<IWMWriterSink> pSink;
if(SUCCEEDED(m_pWriterAdvanced->GetSink(dw, & pSink))) {
CComPtr<IWMWriterFileSink3> pFileSink;
if(SUCCEEDED(pSink.QueryInterface(& pFileSink))) {
pFileSink->SetAutoIndexing(true);
pFileSink.Release();
}
pSink.Release();
}
}
}

Back to top
 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> SDK All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Microsoft Office Forum New Topics
Powered by phpBB