Solved

WMPlayer SDK

Posted on 2004-10-19
4
587 Views
Last Modified: 2008-01-09
I am using the Windows Media Player 9.0 SDK with my C# application.  When my application opens, it opens a specific audio file for playback.  My problem is that I am having a hard time trying to get the duration information from the Media Player until I actually start playing the file.  I start by setting the Player's URL(axPlayer.url = audiofile).  After that I can access axPlayer.currentMedia.duration, but the values are all 0 until I actually call axPlayer.Ctlcontrols.play().  Is there any way I can access the duration of the media file from the player without having to start the file playing??????????

Thanks,
Kendal
0
Comment
Question by:gvector1
4 Comments
 
LVL 18

Expert Comment

by:armoghan
ID: 12355253
0
 

Author Comment

by:gvector1
ID: 12359531
Thanks for the link.  It was very interesting.  I found a solution for my answer in the following form:

IWMPMedia media = axPlayer.newMedia(FinalFile);
endTime = (int)Math.Floor(media.duration);

If I create an actual IWMPMedia object instead of trying to access it through the Player object itself, I can access the duration property.  Thanks for your answer.

Thanks,
Kendal
0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 12394910
Question answered by asker or dialog valuable.
Closed, 500 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now