tags:

views:

302

answers:

1

Hi,

I'm trying to play a song in a WinForms C# application using the AxWMPLib COM control. However, I only want to play a specific 30 second region of that song. So far I can play the track from the beginning of that 30 second region (using the Ctrlcontrols.currentPosition member), but I have no way of specifying the end time.

What's the best way to go about playing only 30 seconds of this track?

+1  A: 

I don't know of a way to do this entirely in the WMP control.

An alternative, and this may not be precise, but you could try creating a Timer with a 30 second tick time, then start that timer when you call axWmp.Play(...). When the timer ticks, call axWmp.Stop().

Judah Himango
I was trying to avoid this, but until a better solution comes along this'll have to do. Thanks :)
Matthew Iselin