问题
mciSendStringi("","","","");
I used the above function to play a mp3 file. Now I want to play the mp3 file from the middle (i.e) if the file is 5:32 minutes long I want to play it from 2:00 minutes. Can any help me how to do it?
回答1:
Something like this perhaps:
long millisecs = 120000;
long status = mciSendString(String.Format("seek MediaFile to {0}", millisecs), null, 0, IntPtr.Zero);
To determine the length of the file, see this post
回答2:
WMPLib is great for it, just do a
Player.controls.currentPosition = (time in seconds);
Unfortunately, I'm not able to get the current position from the same property; so, for now, I'm not able to resume a playback from the time it was paused:
Pausing and resuming mp3 with WMPLib and C#
来源:https://stackoverflow.com/questions/1091570/how-to-play-a-mp3-file-from-the-middle