You don't need a broadcast receiver for this - AudioManager
is your friend:
AudioManager.isMusicActive()
does the job you want, have a closer look here for details: AudioManager
here is an example:
AudioManager manager = (AudioManager)this.getSystemService(Context.AUDIO_SERVICE);
if(manager.isMusicActive())
{
// do something - or do it not
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…