Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

WMPlayer SDK

Posted on 2004-10-19
4
Medium Priority
?
623 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

730 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