最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Flutter LiveKit stream audio error AVAudioSession - Stack Overflow

programmeradmin0浏览0评论

I'm implementing LiveKit in a Flutter app, the video is successfully streamed but when added audio I receive error in console. I don't know if this error is the main problem of not receiving/listening audio. Here is the code that I use to connect to the room. I'm testing on physical device, an iPhone with iOS 17

 Future connectLiveKit(String roomId) async {
    theRoom = Room();
    var options = const ConnectOptions(autoSubscribe: true, protocolVersion: ProtocolVersion.v5);

    var roomOptions = const RoomOptions(
      defaultVideoPublishOptions: VideoPublishOptions(
        simulcast: true,
      ),
    );

    await theRoom!.connect('wss://....', roomId, connectOptions: options, roomOptions: roomOptions);

    theRoom?.addListener(_onRoomDidUpdate);
    roomListener = theRoom?.createListener();

    try {
      await theRoom?.localParticipant?.setCameraEnabled(true);
    } catch (e) {
      print('could not publish video: $e');
    }
    await theRoom?.localParticipant?.setMicrophoneEnabled(true);

    print('Joined room: ${theRoom?.name ?? ""}');
  }

Here some logs:

[LiveKit] Configuring category: AVAudioSessionCategoryPlayback
[LiveKit] Configuring categoryOptions: ["mixWithOthers"]
[LiveKit] Configuring mode: AVAudioSessionModeSpokenAudio
[LiveKit] RTCAudioSession Configure success
[as] ATAudioSessionPropertyManager.mm:359 FAILED to set property 1684431725 on AVAudioSession with error Error Domain=NSOSStatusErrorDomain Code=-50 "(null)"
[LiveKit] Configuring category: AVAudioSessionCategoryPlayAndRecord
[LiveKit] Configuring categoryOptions: ["allowBluetooth", "allowBluetoothA2DP", "allowAirPlay"]
[LiveKit] Configuring mode: AVAudioSessionModeVideoChat
flutter: participants: 1
[LiveKit] RTCAudioSession Configure success
flutter: participants: 1
flutter: Joined room: video-oggi2
flutter: participants: 1
flutter: participants: 1
flutter: participants: 1
flutter: participants: 1
flutter: participants: 1
flutter: participants: 1
flutter: participants: 1
flutter: participants: 1
flutter: participants: 1
flutter: participants: 1
[LiveKit] Configuring category: AVAudioSessionCategoryPlayAndRecord
[LiveKit] Configuring categoryOptions: ["allowBluetooth", "allowBluetoothA2DP", "allowAirPlay"]
[LiveKit] Configuring mode: AVAudioSessionModeVideoChat
[LiveKit] RTCAudioSession Configure success
RTC AudioSession deactive is successful
[LiveKit] Configuring category: AVAudioSessionCategorySoloAmbient
[LiveKit] Configuring categoryOptions: []
[LiveKit] Configuring mode: AVAudioSessionModeDefault
[LiveKit] RTCAudioSession Configure success 

Maybe the problem is in some other part of the code, but I only see these logs and the error: [as] ATAudioSessionPropertyManager.mm:359 FAILED to set property 1684431725 on AVAudioSession with error Error Domain=NSOSStatusErrorDomain Code=-50 "(null)"

发布评论

评论列表(0)

  1. 暂无评论