gpt4 book ai didi

c++ - 如何从 qml webgl 获取麦克风到 c++?

转载 作者:塔克拉玛干 更新时间:2023-11-03 08:03:45 26 4
gpt4 key购买 nike

我正在使用 Qt 和 Qml 进行调用软件,我需要从作为 webgl 运行的 Qml 获取麦克风馈送到 C++ 端,如果不是使用服务器直接到 GStreamer。

我已经有一个 Qt 程序作为客户端使用 GStreamer 将音频流推送到服务器。当然,GStreamer 不会转到 webgl 客户端。我发现,您可以从 Qml 获得使用麦克风/相机的权限,但我还没有找到任何实际从那里获取流的示例。我还检查了 WebRTC 的用法。它似乎可以与 Qml 一起使用,我已经找到了一些将它与 GStreamer 一起使用的示例,但即使使用这些示例,我也无法获得 WebRTC 和 GStreamer 的组合。

所以完整的问题:如何从作为 webgl 运行的 Qml 获取音频? Qt 中有什么方法还是我必须通过 WebRTC?如果是这样,是否有比 Nirbheek's gstwebrtc demos 更简单或更适合初学者的示例?用于将 WebRTC 连接到 GStreamer?

最佳答案

Not the answer I wanted, but this ended up working in my case:

As the C++ side is also running another Qt GUI, Qml to be specific, I can use WebEngineView with html and javascript to never bother the C++ implementation with GStreamer for WebRTC. So currently I'm running PeerJS on both sides of the connection with PeerJS' signaling server in between.

I'd have preferred to use C++ with GStreamer to connect to WebRTC, but I can't find other easy way for me to connect browser's audio to Qt.

编辑:我很抱歉,这个答案最终不起作用。我一直在一台计算机上测试这些程序,因此我没有意识到 WebGL 托管的 Qml 没有在前端运行 WebEngineView 的 Javascript,而是在后端运行。

关于c++ - 如何从 qml webgl 获取麦克风到 c++?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57094736/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com