webrtc-sdk / libwebrtc

A C++ wrapper for binary release, mainly used for flutter-webrtc desktop (windows, linux, embedded).
MIT License
378 stars 77 forks source link

Audio MediaRecord support #85

Closed nikohpng closed 1 year ago

nikohpng commented 1 year ago

audio media record can't support in mac/ios and win. I think this is good feature.

Now I think we need increase the priority of this feature and I am willing to help implement this feature.

Below, I will explain my implementation ideas. If there are no problems, I will start working.

then RTCPeerConnectionFactoryImpl implements the AudioDeviceDataObserver interface to get all audio data, and then transfers it to flutter_webrtc, flutter_webrtc determines the format and method of storage. Of course, this method can be used in both Mac/iOS, and I have implemented the corresponding solution. like this

flutter_webrtc                                                            libwebrtc/ios/mac
FlutterWebRTCBase: AudioDeviceDataObserverSink                            RTCPeerConnectionFactoryImpl: public AudioDeviceDataObserver
                                                                          ADMWrapper(RTCPeerConnectionFactoryImpl)

registerObserver(base)                                                         
                                                                          audio_data =>AudioDeviceDataObserverSink

then we use MediaRecord to recieve FlutterWebRTCBase base audio data. You can do anything In MediaRecord

nikohpng commented 1 year ago

Has anyone replied. If not needed, I will close it.

Of course, if you need anything, you can always contact me

I'm glad to help