Solved

WMPlayer SDK

Posted on 2004-10-19
4
589 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
insert image with its metadata into SQL server Database 3 90
XAML: Layout 8 25
Close form "before" open 3 28
Finally almost got it 5 23
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 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

17 Experts available now in Live!

Get 1:1 Help Now