需要一些有关媒体播放的API [英] Need some APIs about Media Playback

查看:53
本文介绍了需要一些有关媒体播放的API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何确定系统是否在播放音乐.

I want to know how to make sure the system is playing music or not.

如果不播放音乐,我想启动默认的音乐播放器.

And I want to launch the default music player if is not playing music.

我找到了Windows.Media.Playback,但似乎只适用于UWP.

I found Windows.Media.Playback, but it seems just for UWP. 

发现也许我可以使用SendKeys.Send("{SelectMedia}");

found maybe I can use SendKeys.Send("{SelectMedia}");

似乎无法生效.

推荐答案

谢谢您在这里发布.

您的问题是什么项目?

对于Winform,您可以从

For Winform, you could download the source file from Audio and Video Player C# Winform for reference.

对于WPF,您可以从 使用 WPF中的Windows Media Player控件,以供参考.

For WPF, you could download the source file from Using Windows Media Player Control in WPF for reference.

我希望这会有所帮助.

最好的问候,

Wendy


这篇关于需要一些有关媒体播放的API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆