JackFalcon Posted May 16, 2017 Share Posted May 16, 2017 Hello, Evaluating Web Audio API, for 3D sound, mixed HowlerJS with BJS without realizing: Oh, Babylon.Sound ... ? Whylookathat, lots of sound! : ) Thanks to answer below, with links. I will head that way. Related question is around WebAudio API AudioContext and -> compressors, oscillators, reverb, etc. with JS! +1. That should all be available through the AudioContext in Web Audio API... if there is an example. If not. I'll dig down, figure it out, and put it here.... : ) Applying 3D Sound with BABYLON.Sound. : ) Cheers. webGLmmk 1 Quote Link to comment Share on other sites More sharing options...
brianzinn Posted May 16, 2017 Share Posted May 16, 2017 This does not answer your question, but I don't know if you have seen sound.attachToMesh(), which accomplishes what you are trying to do position-wise. Maybe you can copy that? https://github.com/BabylonJS/Babylon.js/blob/7ff79d4805ccbad6f169bf9961c1376c7cff1908/src/Audio/babylon.sound.ts (line 519) https://doc.babylonjs.com/classes/2.5/sound#attachtomesh-meshtoconnectto-rarr-void JackFalcon 1 Quote Link to comment Share on other sites More sharing options...
JackFalcon Posted May 16, 2017 Author Share Posted May 16, 2017 Nice! I hadn't run across that just yet. I'll look into it... thanks. Quote Link to comment Share on other sites More sharing options...
JackFalcon Posted May 16, 2017 Author Share Posted May 16, 2017 Thank you Mr. brianzinn, ~ Babylon.Sound(!?!): https://doc.babylonjs.com/overviews/playing_sounds_and_music Look 3D sound... : ) cool. Remembers two-step process: 1) open file babylon_v3.0_max.js 2) read... sound! Reading through .max.js is really nice... Moves to corner... I'll dig over near that... world conversion to local, matrix transformation mathmatification...real quick before checking out BABYLON.Sound = Sound; thanks... RelatedQuestion: ctx.createOscillator, compressor, filter, delay, convolver... <searches-source-code>...</> ~++/--: ) Quote Link to comment Share on other sites More sharing options...
JackFalcon Posted May 16, 2017 Author Share Posted May 16, 2017 Solution: Babylon.Sound, is pretty great. Even more so after comparison. Sound interface is nicer than others. Here is solution to noisy mesh in relation to hero: var assetsManager = new BABYLON.AssetsManager(scene); var binaryTask3 = assetsManager.addBinaryFileTask("snd3task", "../audio/CC/zap1.wav"); binaryTask3.onSuccess = function (task) { soundObj3 = new BABYLON.Sound("zap1", task.data, scene, null, { loop: true, volume: 2.5, spatialSound: true, distanceModel: "exponential", //"inverse" maxDistance: 10, //distance to 0 volume. rolloffFactor: 2 }); } assetsManager.load(); soundObj3.setPosition(noisyMesh1.position); This simplification was also nice(via brianzinn): soundObj3.attachToMesh(noisyMesh1); in the tutorial, here: https://doc.babylonjs.com/overviews/playing_sounds_and_music Cheers. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.