Thread View: borland.public.cppbuilder.multimedia
1 messages
1 total messages
Started by Kevin Saliga
Thu, 21 Apr 2005 13:11
Controlling Windows Media Player
Author: Kevin Saliga
Date: Thu, 21 Apr 2005 13:11
Date: Thu, 21 Apr 2005 13:11
37 lines
3046 bytes
3046 bytes
I've posted this once before, but am having lots of trouble finding answers to this. I see many places on the internet (when I Google search) of people having the same issue, but no answers seem readily available. I have imported the type library for the Windows Media Player (the older version, not v9, but I believe the issue is in all versions). This allows me to control Windows Media Player via a component on my form, and one of the things I do is control the rate of playback (slower/faster). I use a timer to get the CurrentPosition property and display it in mm:ss format on a label of the form. When I change the rate of playback to faster than normal, the CurrentPosition reports a different value than the actual playback. It reports a value that is greater that the actual position of the recording. The result is that my calc on my timer hits the end before the playback does. Has anyone had this experience or know why this is happening? One prior suggestion was that my timer may not be reacting fast enough, but since it triggers every second, that would mean at most my time would be a second off. But this can be 20 or 30 seconds or more - the problem is exacerbated by the length of the audio file and the amount of time spent at a faster playback rate. My timer should at least get a reasonably close estimate - if it fires every second, it should be within a second each time it fires. But what is happening is that the CurrentPosition is returning that it is at the end of the file 20 to 30 seconds before the media component actually finishes playback. So it's not that the timer isn't keeping up - it's reporting that it's further along in the file's playback than it actually is. I watch the time increment in a TLabel component that displays the CurrentPosition, and the TTimer is incrementing the label with the CurrentPosition, but it's populating the Caption with a time that's beyond the actual CurrentPosition of the playback. I appreciate any insight into this! Kevin Saliga
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads