如果发现音箱在使用? [英] Find if speaker is in use?

查看:185
本文介绍了如果发现音箱在使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android上,是有可能在任何时候找到,如果扬声器正在使用中,如果是哪个应用在使用它。

In Android , is it possible at any given time to find if speaker is in use and if so which app is using it.

对不起,我不知道如何表达出该问题。
我想要做的是找出是否有任何应用程序(音乐播放器)播放音乐文件或者使用扩音器或耳手机。此外,如果有可能找到它的应用程序在使用它。

Sorry i did not know how to phrase the question. What i want to do is find out if any app (Music Player) is playing a music file either using the loud speaker or the ear phones. Also if possible find which app is using it.

对不起,不知道该怎么短语这一点。

Sorry Don't know how else to phrase this.

推荐答案

我需要这找到,如果音乐正在播放设备。我发现功能
AudioManager下 isMusicActive()。它返回true,只有当音乐确实正在播放,
其假evnen当玩家在前景和暂停。它为我工作至今。

I needed this to find if music is currently playing on the device. I found the function isMusicActive() under AudioManager. It returns true only when music is actually playing, its false evnen when player is in foreground and paused. Its worked for me so far.

这篇关于如果发现音箱在使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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