Solved

WMPlayer SDK

Posted on 2004-10-19
4
596 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…

740 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