TSINGSEE green rhino video development webrtc browser uses the video tag to play webrtc local recording audio implementation process

TSINGSEE Green Rhinoceros Video Team has many problems in the development of webrtc. We have all written in previous blog posts. The main purpose of webrtc development is to provide a better R&D solution for our video platform. In the near future, webrtc will It will be more closely integrated with the TSINGSEE video platform.

webrtc2.png

Webrtc is a big project, including video and audio. Up to now, TSINGSEE Green Rhino Video needs to develop Webrtc to realize local recording, and use the video tag to play audio in the browser to prepare for the later product development.

Through the previous research, we have implemented webrtc video streaming, that is, the acquired images are realized by the OnFrame function to achieve a frame by frame image; then we may think that there should also be a function for webrtc to implement audio pushing flow.

108.png

But in fact, the webrtc audio stream does not have the OnFrame function to push the video tag to the browser frame by frame, so audio playback is still required to have a complete audio and video stream.

Let's share the implementation of webrtc pushing audio stream:

Audio collection, playback and recording are mainly: AudioDeviceModule class, this class has many virtual functions, which must be written to realize audio sending.

(1) AudioDeviceModule class virtual functions are written more code (part of the code).

109.png

110.png

(2) Audio also has a MessageHandler class, which has an OnMessage function;
to receive feedback, and push the stream through OnMessage feedback information.

111.png

(3) OnMeaasge feedback to receive audio, the realization of the functions inside:

112.png

(4) The rewritten code is completed, and the function can be called in the next step.

113.png

Guess you like

Origin blog.csdn.net/Black_3717/article/details/112904225