Agora-Flutter-SDK icon indicating copy to clipboard operation
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 ?

Open Codesait opened this issue 3 years ago • 5 comments

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 ?

Codesait avatar Mar 07 '22 10:03 Codesait

have you called enableAudioVolumeIndication?

LichKing-2234 avatar Mar 09 '22 07:03 LichKing-2234

have you called enableAudioVolumeIndication?

Yes i did, else i won't receive other users audio indication

Screenshot 2022-03-09 at 11 25 20 AM

Codesait avatar Mar 09 '22 10:03 Codesait

could you pls double check your client role is broadcaster?

LichKing-2234 avatar Mar 09 '22 11:03 LichKing-2234

could you pls double check your client role is broadcaster?

Yes it is because i can be heard by room audience.

Codesait avatar Mar 10 '22 06:03 Codesait

could you pls double check your client role is broadcaster?

how does the audience know who is speaking?

EhisEA avatar Jul 13 '22 17:07 EhisEA

If you still face issues, please try upgrading to the new version to see if it works for you.

littleGnAl avatar Nov 14 '23 08:11 littleGnAl

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.

github-actions[bot] avatar Nov 28 '23 09:11 github-actions[bot]

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.

github-actions[bot] avatar Dec 05 '23 10:12 github-actions[bot]