1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Flutter webRtc unable to Record audio only file

Discussão em 'Mobile' iniciado por Stack, Outubro 10, 2024 às 06:12.

  1. Stack

    Stack Membro Participativo

    tried to develop audio calling app using flutter webrtc , the call are working well but, need record audio call only, currently flutter webrtc not support record audio call only, if any one know any other idea please share.

    void _startRecordingN() async {
    try {
    if (_localStream == null) throw Exception('Stream is not initialized');
    if (Platform.isIOS) {
    print('Recording is not available on iOS');
    return;
    }
    // TODO(rostopira): request write storage permission
    final storagePath = await getExternalStorageDirectory();
    if (storagePath == null) throw Exception('Can\'t find storagePath');
    final filePath = storagePath.path + '/webrtc_sample/test.mp3';
    _mediaRecorder = MediaRecorder();
    setState(() {});

    //final videoTrack = _localStream!
    // .getVideoTracks()
    // .firstWhere((track) => track.kind == 'video');

    await _mediaRecorder!.start(
    filePath,
    audioChannel: RecorderAudioChannel.INPUT,
    //videoTrack: audioTrack,
    );
    } catch (e) {
    print('exception::$e');
    }
    }


    Error Log: E/MediaRecorderImpl( 5137): Video track is null D/FlutterWebRTCPlugin( 5137): startRecordToFile(): Audio-only recording not implemented yet I/flutter ( 5137): exception::platformException(startRecordToFile, startRecordToFile(): Audio-only recording not implemented yet, null, null)

    Continue reading...

Compartilhe esta Página