Agora-Flutter-SDK
Agora-Flutter-SDK copied to clipboard
Current device(Android) is not emitting/ receiving onAudioVolumeIndicate and remoteAudioStateChanged events sent from it, but the second device is ?
Describe the bug
Current Android device is not receiving onAudioVolumeIndicate and remoteAudioStateChanged events sent from it... probably other events too but i've not checked all, but other devices are getting the events ? e.g -- when onAudioVolumeIndicate emits events, i never get my uid in the AudioVolumeInfo (speaker) from the device that is speaking. -- For remoteAudioStateChanged, current device which triggered mute doesn't get the event but it does for other devices in the channel.
i am currently using agora_rtc_engine: ^4.2.1
Expected behavior I expect to receive event from RtcEngineEventHandler on every device/emulator even the device triggering the event.
Smartphone: Device: Android Version: version 11(real device) and android 12(emulator)
Additional context Here are some snippets:
Future<void> initializeAgora(
RtcEngine engine, {
bool? exists,
bool? onStage,
OngoingRoom? room,
Function(ErrorCode code)? onError,
Function(RtcStats stats)? onLeaveChannel,
Function(List<AudioVolumeInfo> speakers, int totalVolume)?
onAudioVolumeIndicate,
Function(String channle, int uid, int elapsed)? joinChannelSuccess,
Function(int uid, UserOfflineReason elapsed)? userOffline,
Function(int uid, AudioRemoteState state, AudioRemoteStateReason reason,
int elapse)?
remoteAudioStateChanged,
}) async {
await _initAgoraRtcEngine(
engine,
exists: exists!,
room: room,
onStage: onStage!,
);
_addAgoraEventHandlers(engine,
onError: onError,
onAudionVolumeIndicate: onAudioVolumeIndicate,
onLeaveChannel: onLeaveChannel,
userOffline: userOffline,
joinChannelSuccess: joinChannelSuccess,
remoteAudioStateChanged: remoteAudioStateChanged);
}
void _addAgoraEventHandlers(
RtcEngine engine, {
Function(ErrorCode code)? onError,
Function(RtcStats stats)? onLeaveChannel,
Function(List<AudioVolumeInfo> speakers, int totalVolume)?
onAudionVolumeIndicate,
Function(String channle, int uid, int elapsed)? joinChannelSuccess,
Function(int uid, UserOfflineReason elapsed)? userOffline,
Function(int uid, AudioRemoteState state, AudioRemoteStateReason reason,
int elapse)?
remoteAudioStateChanged,
}) {
engine.setEventHandler(RtcEngineEventHandler(
error: onError,
joinChannelSuccess: joinChannelSuccess,
leaveChannel: onLeaveChannel,
userOffline: userOffline,
audioRouteChanged: (AudioOutputRouting audioOutputRouting) {
log.i("audioOutputRouting " + audioOutputRouting.index.toString());
},
userJoined: (uid, elapsed) {
log.i('userJoined: $uid');
},
audioVolumeIndication: onAudionVolumeIndicate,
remoteAudioStateChanged: remoteAudioStateChanged,
localAudioStateChanged: (AudioLocalState state, AudioLocalError e) {
log.i('local audio state: $state');
}));
}
Any work around for this ?
have you called enableAudioVolumeIndication?
have you called enableAudioVolumeIndication?
Yes i did, else i won't receive other users audio indication
could you pls double check your client role is broadcaster?
could you pls double check your client role is broadcaster?
Yes it is because i can be heard by room audience.
could you pls double check your client role is broadcaster?
how does the audience know who is speaking?
If you still face issues, please try upgrading to the new version to see if it works for you.
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please raise a new issue.