visualize mediastream which is coming from a remote peer connection

假如想象 提交于 2019-12-06 08:22:08

I found a simple "solution" at least for the next time:

I have plugged a male / male audio cable from microphone to headphone in all my clients. Then I read the local microphone stream and, what a miracle, i can visualize what Im hearing.

Not a good solution, but it`s doing the job..

One Question: Is it possible to re-grab the destination as a stream in javascript? Then I would not need the audio cables..

Note that analysing remote streams should work for Firefox and it is known to not to work in Chrome, see http://code.google.com/p/chromium/issues/detail?id=241543

A possible workaround could be taking the remote audio level value by using WebRTC statistics API.

If you go to chrome://webrtc-internals/ then select your page playing remote stream then one of the ssrc_XXXX_recv will contain dynamically changing audioOutputLevel value which you can use.

You can access the value using Chrome PeerConnection's statistics API, specifically, getStats() method.

A possible downside may be that this is the value of actual sound the user hears from the video/audio element, so if the user mutes or changes volume of the media element, it will affect the audioOutputLevel value.

Good luck! :-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!