简体   繁体   English

使用WMPLib.WindowsMediaPlayer在c#winforms中恢复暂停的mp3文件

[英]resume a paused mp3 file in c# winforms using WMPLib.WindowsMediaPlayer

with WMPLib.WindowsMediaPlayer i am able to play and pause mp3 files but i am not able to resume from the paused point. 使用WMPLib.WindowsMediaPlayer,我可以播放和暂停mp3文件,但无法从暂停的点继续播放。

Can anybody tell me how to resume the song 有人可以告诉我如何恢复这首歌吗

thanks 谢谢

Actually I think that it's quiet easy I use the "Pause" method to pause the song and "Play" method to continue it ::: here is the code that I've used 实际上,我认为这很安静,我可以使用“暂停”方法暂停歌曲,并使用“播放”方法继续播放:::这是我使用的代码

WMPLib.WindowsMediaPlayer wmp = new WMPLib.WindowsMediaPlayer();
wmp.url="the mp3 path that you want to play";
//NOTE::: after the above command the mp3 file or other multimedia file will automatically play.

//And for PAUSING use this code:
wmp.controls.pause();

//AND for continue PLAYING use below code:
wmp.controls.play();

this code works for me and I hope that works for you. 该代码对我有用,我希望对您有用。

The solution is change media players. 解决方案是更换媒体播放器。 Add a reference to this player: AxWMPLib.AxWindowsMediaPlayer . 添加对此播放器的引用: AxWMPLib.AxWindowsMediaPlayer I found a reference in This project . 我在此项目中找到了参考。

I simply changed the player reference. 我只是更改了玩家参考。 Tweaked the properties: This " moPlayer.Controls.pause() " became " moPlayer.Ctlcontrols.pause() " and I was in business. 调整了属性:这个“ moPlayer.Controls.pause() ”变成了“ moPlayer.Ctlcontrols.pause() ”,我开始做生意。 I hope this helps. 我希望这有帮助。 I did this and my player can pause and resume. 我做到了,我的播放器可以暂停并继续。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM