Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hello Ambiera, niko, and fine folks of this forum! First, niko thank you so much for sharing CopperLicht and CopperCube! They're both really amazing and a lot of fun. I've worked quite a bit with some of the other JS/WebGL libraries out there and really admire what you've done. CopperLicht coded in a straight-foward way, it's friendly, it's efficient, and it's fast! Like someone else mentioned, there doesn't seem to be a tutorial or example for making sound with CopperLicht alone (and the documentation for SoundSourceNode is a little thinner than most), so I thought I'd post the way that I've been doing it in the hopes that I can get some feedback if I'm doing it wrong or help someone else out if I'm doing it right. Had some trouble with whole post so I'm going to break this up... |
||||
|
As far as I can tell, after you've started the engine, you need to do at least the following to make a CopperLicht sound from a local source file and then play it: var sound = new CL3D.SoundSceneNode(); CL3D.gSoundManager is made at startup from CL3D.SoundManager. (Neither it nor the property "TheSound" shows up in the documentation.) To make it positional (louder when closer and softer when farther away), a few properties needed to be changed from defaults (before startSound):
Anyone else doing this the same way, a different way, a better way? Let me know. Thanks! |
||||
|
Yes, that's how it works, but you can also always just use the HTML audio API. The sound manager in CopperLicht is only there so that it can play back sounds from CopperCube, usually not intended for puplic use. But of course, if it works for you, just use it. |
|