Use of stream types is deprecated for operations other than volume control

Android集成环信,收到语音消息使用耳机自动播放没有声音,点击播放有声音,使用扬声器自动播放时正常

W/AudioManager: Use of stream types is deprecated for operations other than volume control
W/AudioManager: See the documentation of requestAudioFocus() for what to use instead with android.media.AudioAttributes to qualify your playback use case
D/ConcurrentMediaPlayer: pauseMusic bMute=true result=true
D/AudioManager: dispatching onAudioFocusChange(-2) to android.media.AudioManager@3db335fcom.yaxunkeji.talkback.helper.ChatHelper$3@87601ac
D/ChatHelper: onAudioFocusChange focusChange = -2
I/HomeFragment: 频道: 49531964162052,未读消息数量:11
V/MediaPlayer: resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer: cleanDrmObj: mDrmObj=null mDrmSessionId=null
I/MessageHelper: onCompletion: 自动播放完一条未读语音消息
I/MessageHelper: onCompletion: 已播放完所有未读语音消息
D/AudioManager: dispatching onAudioFocusChange(-3) to android.media.AudioManager@3db335fcom.hyphenate.easeui.widget.chatrow.EaseChatRowVoicePlayer$2@d27c63b
D/ConcurrentMediaPlayer: onAudioFocusChange focusChange = -3
D/AudioManager: dispatching onAudioFocusChange(1) to android.media.AudioManager@3db335fcom.hyphenate.easeui.widget.chatrow.EaseChatRowVoicePlayer$2@d27c63b
D/ConcurrentMediaPlayer: onAudioFocusChange focusChange = 1

已解决。问题在于接收到消息时播放了提示音,此时又马上播放语音消息,两者起冲突,所以播放语音消息时没有声音。requestAudioFocus音频焦点冲突

你可能感兴趣的:(Use of stream types is deprecated for operations other than volume control)