Find if speaker is in use?

2019-05-30 00:19发布

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.

1条回答
smile是对你的礼貌
2楼-- · 2019-05-30 00:44

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.

查看更多
登录 后发表回答