Solved

WMPlayer SDK

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
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.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

615 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