three.js带WebRTC问题的位置音频设置MediaStreamSource(听不到任何声音)

大家好! 我在discord上问了这个问题,但没有得到回应。我在下面添加了更多信息,希望能帮助澄清我的问题。 我有一个传入的WebRTC音频/视频流,我正在将其拆分为视频流用作纹理,还有一个音频流,我正在尝试将其用作定位音频的源对象。我正在使用positionAudio.setMediaStreamSource功能3和r115版本。运行以下代码后,我在场景中获得一个音频对象(即,如果我打印出来场景.儿童,我看到下面有一个MediaStreamSourceNode的对象AudioObj.context.source). 但是,我什么也没听到。 任何关于如何调试的建议都将是超级> 相关问题:如何使用AudioLoader在音频中传输音频?问题仅供参考:下一版本R109,三、音频提供一个新方法。setMediaStreamSource()用于将Web RTC媒体流包括到Web音频管道中。可能对您有用stackoverflow.com带有WebRTC流的ThreeJS位置音频不会产生声音22three.js问byRmRon UTC时间18日上午9:10-6月22日由lukasIO在post#34中解决,我发现我和@cat在这里做错了什么…而不是this.positionAudio.setMediaElementSource(这是音频元素);我们需要使用this.positionAudio.setMediaStreamSource(this.audioElement.srcObject)为了让它在chrome中工作…猫: 但是,我什么也没听到。 你能不能先用THREE.Audio而不是THREE.PositionalAudio试试?只是为了确保没有转换问题。 好的,确认了这对>/pre> 不起作用(没有声音),有趣的是, 1. 这对来自Navigator.GetUserMedia() 2. 的本地音频流起作用。当我将相同的音频流导入一个元素时,我可以听到>/pre>有什么想法吗?能否将代码作为git存储库共享?或者作为一个可编辑的实时示例?当然可以,那辆车相关代码在public/js/index.js: 260(我刚刚很快适应了在没有我的WebRTC ICE服务器提供商(Twilio)的情况下工作,所以如果有任何东西不工作,请告诉我,我会看一看)GitHubAidanNelson/YORB2020 10YORB2020是一个共享的在线空间,可以闲逛、协作和工作。-艾登尼尔森/约尔B2020谢谢!下载repo并安装依赖项后,我在使用
pm start时遇到以下运行时错误:/YORB2020主/节点\\模块/twilio/lib/rest/Twilio.js:126抛出新错误(“需要用户名”);^错误:在新的Twilio(/yorb020 master/node_modules/Twilio/lib/rest)中需要用户名/Twilio.js:126:11)在初始值设定项(/YORB2020主/节点\\模块/twilio/lib/index.js:9:10)在对象上。(/YRB020主机/server.js:57:39)如何启动应用程序?Mugen87:如何启动应用程序?我刚刚推动了一项更改(完全删除了Twilio)。如果你git pull,它应该可以工作现在,让我们如果不是这样,请告诉我。谢谢!最小设置应为:*let>And that actually works in Firefox, but not in Chrome. Can you please also make a test with FF?Okay.Tested the following with Firefox (75.0) and heard the incoming WebRTC>then tested with positionalAudio and also heard the incoming stream , but without positional effects. (EDIT: PositionalAudio is working in FireFox using the code below.)I played with the RolloffFactor and RefDistance and DistanceModel as well, but to no avail.Ideally, I\"d like to hear the sound when within 5 units or so, then not hear it at all.(I am assuming distance units match three.js world units?)let>I\"m wondering whether it is okay that my AudioListener is parented to a group rather than an object3D? cat:I\"m wondering whether it is okay that my AudioListener is parented to a group rather than an object3D?Normally, the listener should be added to the camera.After some research, it seems the minimal setup reproduces this bug in>Okay.See above edit (the above code works in Firefox 75.0) and PositionalAudio works as well.Should I submit an issue for Chrome?Or is there more I can do to debug on my end?Thank you again! cat:Should I submit an issue for Chrome?There is already an issue. Please check out the link in my previous post. cat:Or is there more I can do to debug on my end?Unfortunately no, this is a browser bug.I meant an issue on the three.js repo, just so it is visible to the three.js community? Let me know.Thanks again for the help! That was a persnickety little bug.I think the discussion in this topic is sufficient. Especially since we can\"t fix this issue on our side.Hi @Mugen87, just wanted to follow up on this thread as it seems the Chromium bug thread 7 has now referenced this thread.A user there has mention a possible solution:Create an HTML5 audio element,Set the audio element source to the incoming MediaStream,Use that audio element as a source for the webAudio positional audio object.I am trying to implement this, but am running into the issue of both audio sources (the HTML5 audio element and the WebAudio / three.js positionalAudio) now playing (and therefore losing the the stereo imaging / positional-ity of the positionalAudio).Do you have any recommendations for this? cat:A user there has mention a possible solution:That user was me . cat:Do you have any recommendations for this?Um, that does not sound right to me. I\"ve tested this workaround successfully on my computer Mugen87:Um, that does not sound right to me. I\"ve tested this workaround successfully on my computer Ahh, wonderful!Well, maybe you could tell me what I was doing wrong here?I am using Mediasoup 3 as a selective forwarding unit server, so consumer指传入的媒体源。*// Create HTML audio = consumer;// THREE.js> cat:These two lines should not be necessary.I was mainly using those two lines to test different scenarios.Here is my current issue:When the HTML audio element is playing:In Firefox (75.0), I can set the HTML audio element volume to 0 and can still hear the positionalAudio.In Chrome, when I set the HTML audio element volume to 0, I cannot hear positionalAudio.To be clear, it is unclear whether I am hearing positionalAudio when the HTML audio volume is active over the sound of the global audio. When the HTML audio is not playing:In Firefox and Chrome, I don\"t hear the PositionalAudio object.Could you share your workaround test code?I\"m wondering if I am missing something simple…This example uses an HTML5 audio element and passes it to an instance of PositionalAudio.https://threejs.org/examples/webaudio\\u35唯一的区别是音频元素的创建方式。虽然这不重要 3. Create an HTML5 audio element, 4. Set the audio element source to the incoming MediaStream, 5. Use that audio element as a source for the webAudio positional audio object. 6. In Firefox (75.0), I can set the HTML audio element volume to 0 and can still hear the positionalAudio. 7. In Chrome, when I set the HTML audio element volume to 0, I cannot hear positionalAudio.To be clear, it is unclear whether I am hearing positionalAudio when the HTML audio volume is active over the sound of the global audio. 8. In Firefox and Chrome, I don\"t hear the PositionalAudio object.

three.js[已解决]正交摄影机的变换控件:gizmos缩放问题

您好,我正在使用带轨道控制的正交摄影机。我注意到当缩放照相机变焦不改变相机的位置(如透视相机)。首先,我想知道为什么这两个相机的实现方式不同?第二,我也在使用TransformControls,对于透视摄影机,更新功能上的小控件的重新缩放在这个等式中非常有效>但是使用OrbitControls更改缩放而不是正交摄影机的位置时,它没有正常工作。我试着像这样在等式中添加缩放,但没有得到任何好的结果>我应该以不同的方式包括它吗?我应该使用其他控件吗?谢谢大家的帮助!NaDaMa:首先,我很想了解为什么这两个摄像头...

日期:2021-12-11 08:00:01 浏览:1739

three.js多次渲染同一模型(obj模型),FPS要低得多

我试图在程序中渲染150个相同的树模型,但FPS突然从60下降到30+。你能告诉我什么是最好的解决办法吗?非常感谢。和平与爱。skr有两种典型的方法可以解决这个性能问题(太多的绘制调用):- 使用实例化渲染- 将所有几何体合并为一个几何体(因此只有一个网格)...

日期:2021-12-11 08:00:02 浏览:1746

three.js可缩放场景背景

three.js大家好,我有一个场景,由一个物体(反射雕像)组成,保持在一个漂亮背景的中心。我一直在使用威尼斯日落矩形hdr地图作为我的场景背景它既可以作为环境地图,也可以作为背景我看到背景不会与场景中渲染的网格一起缩放。这给人一种场景完全是假的感觉。i、 e状态向上/向下缩放,但背景不缩放。目前,我已经禁用了放大/缩小功能,这样用户就不会感到害怕。我的问题是:1. 当轨道控制放大/缩小时,我是否需要在此处使用一些着色器魔法来放大或缩小场景背景,以便看起来场景中的所有对象都在均匀缩放?或者这根本不可能做到?...

日期:2021-12-11 09:00:02 浏览:1272

three.js移动导入的Gltf模型

three.js我导入了我的gltf模型并将其添加到场景中,但现在如果我尝试移动它,它将不会=新建三、几何();var=混音器( 模型动画[0]>如何移动模式?Prakar_Srivastava:var>3D对象不能是Geometry或BufferGeometry类型。它应该是Object3D或类似Mesh、Points或Line的派生类的实例。在您的情况下,我只是这样声明变量:var mode;在动画循环中,执行以下操作:如果(mod!==未定义)>还请记住,基本3D场景的重要部分在代码片段中丢失(例如相...

日期:2021-12-11 10:00:01 浏览:1111

three.js平面明暗处理的问题

three.js嗨!我在项目中使用节点材质。我在模型渲染方面有问题。它看起来像是真实的平面阴影。如何平滑多边形?也有点像低分辨率阴影纹理贴图的自阴影。可能不是,但可能是。@Arkadiy\\u Vinkovskiy您需要在您的帖子中添加更多细节。屏幕截图不足以说明这里发生了什么。始终包括引起问题的代码,如果您使用的是模型,也要包括这些代码。更好的是,使用codepe制作一个工作示例...

日期:2021-12-11 10:00:02 浏览:997

three.js如何渲染立方体材质?

您好,直到昨天,我才相信Object3D是一组网格,而网格是一组几何体+材质,每个对象只有一个对象。我发现了立方体材质的结构,因此object3D的网格包含1个几何体(boxGeometry)和6个材质!所以问题是,这种网格的渲染效果如何?有关于它的文件吗?(这是为了提高我对three.js)非常感谢还有其他问题,与我的上一个帖子相关,如果一个网格中可能有多个材质,如何设置CustomDistanceMaterial以考虑所有材质的所有贴图?elysium11:所以问题是,渲染如何在这种类型的网格上工作?您...

日期:2021-12-11 11:00:03 浏览:856

three.js如何创建要在网格中拟合的线段

three.js伙计们,我想帮忙,假设我有一个这样的网格图像718×729 1.25 KB我想在网格面内创建线段,也就是说,我想将网格转换成这样的线图像710×828 740字节有人能帮忙吗???...

日期:2021-12-11 12:00:01 浏览:908

three.jsGLTFLoader.js这是我的登记簿错误

three.js每当我试着做决定的时候3.GLTFLoader对象我收到此错误代码:“未捕获类型错误:这是我的登记簿不是一个函数“我需要帮助!由Penta#u Trax在post#5中解决我最终发现我一直在使用错误的文件,当你需要使用jsm/example时,我使用的是js/example。其他东西也是个问题。但这是问题的基础。你能给我们看看你的代码吗?通常,如果你使用的是import语句,GLTFLoader不需要在前面加三个字符。好的,所以在这之前,我刚刚关注了这个视频,因为它是去年发布的。但是现在我试...

日期:2021-12-11 12:00:02 浏览:1068

three.js使用threejs的光流

嘿,我需要通过我的屏幕显示一束移动的光束。我不想使用任何模型或动画。我想知道我是否可以单独使用threejs来实现这一点。我也应该能够控制其运动的颜色强度和路径。嗨!也许这会有帮助:GitHub-jeromeetienne/三倍体积聚光灯: three.js扩展以提供体积聚光灯13,用于可视化光锥。您可以使用THREE.Curve()设置其路径。控制颜色强度,可能取决于曲线上的位置,也可以使用tween.js或者GSAP用于复杂的动画。创造力取决于您这是您想要的吗?https://threejs.org/e...

日期:2021-12-11 13:00:01 浏览:1314

three.js使用光线投射动态绘制多边形

我要画多边形three.js具有交点。为此,我使用下面的函数。首先,我使用光线投射器在第一个交点的第一个点添加球体。每次单击后,在交点处创建新球体,并在该交点和上一点之间创建线。现在,我希望在第一次单击时关闭多边形指向或单击该点周围。如何实现此目标。raycaster params是否与网格一起工作以检测鼠标位置周围的网格?function checkIntersectionclick() = raycaster.intersectObjects(addedObject, true);if (interse...

日期:2021-12-11 13:00:02 浏览:868