Immersive 3D Audio and Visualization (three.js & javascript)

Sdílet
Vložit
  • čas přidán 8. 03. 2022
  • I'll show you how to integrate 3d positional sound in JavaScript and build an audio visualizer.
    Support me on:
    Patreon: / simondevyt
    Follow me on:
    Twitter: / iced_coffee_dev
    Instagram: / beer_and_code
    Github: github.com/simondevyoutube/
    I'll step through getting audio and 3d positional audio working in JavaScript using three.js, and we'll build out a couple simple audio visualizers using the AudioAnalyzer class.
    Full source code for the project is available, so if you're interested in fiddling with the code, screwing around with it, or improving it.
    Inigo Quilez's Site:
    iquilezles.org/
    Music: www.bensound.com
  • Věda a technologie

Komentáře • 61

  • @simondev758
    @simondev758  Před 2 lety +2

    If you enjyoed this, check out my GLSL course: simondev.teachable.com/p/glsl-shaders-from-scratch
    Or support me on patreon!: www.patreon.com/simondevyt

    • @tomiwaibrahim6198
      @tomiwaibrahim6198 Před 5 měsíci

      @simondev758 Really nice video! I can't find the code for some reason, could you send the link to the code? I am currently working on a project and have no idea how to replicate that. Thank you!

  • @SuperPicolin0
    @SuperPicolin0 Před 2 lety +6

    Please keep the three.js videos coming, I love to see how something mindblowing to me is a child game to others, very inspiring!

  • @robertwallace5498
    @robertwallace5498 Před 2 lety +5

    It is amazing how much sound impacts the feel of the world, great video as always

  •  Před 2 lety +2

    Thanks for sharing, Simon. I really like the way you transform the Three.js docs in understandable concepts.
    Please keep the good work. 🙏🏻

  • @kephas-media
    @kephas-media Před 2 lety +7

    Three has an analyzer class? Nice, really helps those who don't have the time to fully embrace Web Audio API

  • @tonymasse3887
    @tonymasse3887 Před 2 lety +34

    Totally useless to me (i'm not coding 3d worlds), but absolutely awesome! :)
    Your series about ThreeJS is brilliant. Please do keep going!

    • @simondev758
      @simondev758  Před 2 lety +11

      Hah I saw the first part, and was disappointed for a second until I read the rest of your message :)

    • @tonymasse3887
      @tonymasse3887 Před 2 lety +9

      @@simondev758 Usefulness is not a top criteria for me.
      I love watching great craftmanship, virtually no matter the craft. It just happens that on this one (JS) I have experience and can actually grasp the extent of the greatness :)

  • @phoenixxofficial
    @phoenixxofficial Před 5 měsíci +1

    As a creative and aspiring dev, watching your videos is a breath of fresh air in this oversaturated "11 things you shou..." CZcams meta
    Gonna pick up some extra shifts at my job so I can buy your courses and support 🙏🏾
    Thank you for the awesome content 💜 (and for showing people that JavaScript really isn't that bad 😂)

  • @TheMisieq93
    @TheMisieq93 Před 2 lety +1

    This is simply amazing... Thanks for sharing!

  • @samuelkahunga5987
    @samuelkahunga5987 Před 2 lety +1

    great content, you are on the way up bro 👍

  • @swoorp
    @swoorp Před 2 lety +1

    This was much needed!!!! Thank you!

  • @covenantersoldier9165
    @covenantersoldier9165 Před rokem +1

    ahh oh my days, i used to work with babylon. truly do thank you simon.

  • @user-fu8pd4cf6v
    @user-fu8pd4cf6v Před 2 lety +1

    Awesome stuff!

  • @__gustavonovaes
    @__gustavonovaes Před 2 lety +1

    Awesome! Three.js is really handy!

  • @yangnc8416
    @yangnc8416 Před 2 lety +1

    awesome work

  • @spaceymen
    @spaceymen Před 2 lety +1

    Wow! Pretty easy and intuitive.

  • @RaulikiDJ
    @RaulikiDJ Před 2 lety +1

    Many thanks for publish the code!

  • @aayushjamuar9900
    @aayushjamuar9900 Před rokem

    DUDE This is what I was looking for

  • @vomaxHELLnO
    @vomaxHELLnO Před 2 lety +1

    Awesome, thanks!

  • @glowiever
    @glowiever Před 2 lety +4

    wow threejs got 3d audio. meanwhile in c++ there's no hassle free and truly free 3d audio library

    • @benebene9525
      @benebene9525 Před 2 lety +1

      Three.js is an external library. There are plenty of external and cross-platform libraries for c++ that can add audio (for example openAL)

  • @robksawyer
    @robksawyer Před 2 lety +1

    It'd be great to see some of your tutorials use React Three Fiber. Thanks again, rad stuff!

  • @findjonmoses
    @findjonmoses Před 2 lety +1

    Wow!

  • @petebaron
    @petebaron Před 2 lety +1

    so many applications for the (coming soon) metaverse

  • @TitanNanoDE
    @TitanNanoDE Před 2 lety +1

    I'm really enjoying your videos, they are very informative and neatly condensed without any unnecessary fluff. Have you ever looked at the Godot engine? I'm asking because I really enjoy working with it and was wondering what you think about it.

    • @simondev758
      @simondev758  Před 2 lety

      Nah never tried it out. I might go fiddle with it, or Unity/Unreal one of these days.

  • @tomerhertz8502
    @tomerhertz8502 Před rokem

    firstly i absolutely love your tutorials ...some of the best i have encounter in the field (i come from ai / python)
    if i can ask you to review your code, since when i try to run it, it gives just a black screen,
    also you have a great voice, very relaxing to hear

    • @simondev758
      @simondev758  Před rokem

      How are you running it? Also, I don't guarantee that it continues running forever. It works when I upload it, but after that, who knows. Chrome changes frequently, and once this is a year or 2 old, it may need tweaking to get back into a working state.

  • @finalproject8821
    @finalproject8821 Před 2 lety +1

    This is so good! Keep it up man! What's the name of the repo for the source code btw?

    • @simondev758
      @simondev758  Před 2 lety

      github.com/simondevyoutube/ThreeJS_Tutorial_3DSound

  • @guialmachado
    @guialmachado Před 2 lety +1

    Can you make a video showing the same content but with a moving object, like an online player walking and making the sound move through the scene? Gun fires would be amazing

  • @slow5oh523
    @slow5oh523 Před 2 lety

    I hate how calming your voice is.... Can you just.... make audiobooks............... Like I find myself staying up till 3am watching your videos anyway... lmao

  • @bibekbhusansahoo9412
    @bibekbhusansahoo9412 Před 2 lety

    Bro can you make a video on how to export modifier animation from blender for threejs. I tried exporting but got rigid mesh without any animation

  • @yilu7734
    @yilu7734 Před 2 lety +1

    excellent,is three have immersive skybox,such as cloud system。。。

  • @ilyaskuru9055
    @ilyaskuru9055 Před 2 lety +4

    Beta Noobs: No! You can’t just make every big game on a web browser, you have to use C++ and Engine!
    SimonDev: Javascript And HTML go brr

  • @JazzFanss
    @JazzFanss Před 2 lety +1

    Space Odyssey!

  • @thechallenge293
    @thechallenge293 Před 2 lety +1

    Hi can you make a tutorial about text? What if one have to create a game with a lot of textual elements?
    Another thing i would like to know is how would you create the in-game gui? Animated buttons maybe with gifs or other moving parts?

    • @simondev758
      @simondev758  Před 2 lety

      Creating in-world text? Or UI text & gui?

    • @thechallenge293
      @thechallenge293 Před 2 lety

      @@simondev758 All of that but mostly 3d GUI. What should i use to create 3d buttons? PlaneGeometry? What is the best way to make in-game gui (hud, menus, items names etc..)?

  • @spaceymen
    @spaceymen Před 2 lety +1

    Try BabylonJS too sometime in a future video.

    • @simondev758
      @simondev758  Před 2 lety +2

      I keep meaning to, maybe a Three.js vs BabylonJS video is in order.

  • @kian7032
    @kian7032 Před 2 lety +1

    Can you a 3D game with support of mobile

  • @nutzeeer
    @nutzeeer Před rokem

    Can this also create binaural audio? Sounds are changed by the shape of your ears. Special microphones are available. Check out the virtual barber on youtube. Its like you are not even wearing headphones. Is this possible to calculate on the fly?
    I remember from my windows xp days that my soundcard supported EAX for virtual surround. Maybe that was something like that.

    • @nutzeeer
      @nutzeeer Před rokem

      My guess as a leading industry expert is that binaural audio can be calculated by audio raytracing with a virtual ear. Though ears are soft and sound moves through them. As well as the head. But i guess each sound can be processed just once and then saved as a binaural version. This could turn immersiveness up to 11.
      hm i bet the ear and head influence can be calculated just once for each frequency and then pressed into a mathemathical function. Distance also has an effect. And of course the angle.

    • @nutzeeer
      @nutzeeer Před rokem

      Maybe there is an easier solution than slapping raytracing on it. Also since its soundwaves, not rays.
      I bet its possible to have a 96 kHz audio simulation using fluid dynamics or something similar. Corners can be cut. I bet math can save a lot of processing time.

    • @nutzeeer
      @nutzeeer Před rokem

      One thing of importance is that even if a sound comes directly from the left the right ear tends to also hear it, since we are usually in a reflective environment. Going in the worlds most silent room creates the feeling of pressure since no sound is reflected. This has to be calculated in real time though, depending on wall or object distance

  • @uiunicorn2018
    @uiunicorn2018 Před 2 lety

    Can I ask what the setTimeout is for ?

    • @simondev758
      @simondev758  Před 2 lety +1

      So that it give me a bit of time to wander around before the music starts. Mostly so I could record the video.

    • @uiunicorn2018
      @uiunicorn2018 Před 2 lety

      @@simondev758 can't wait to try this with my "friendly" npc czcams.com/video/tDHzJlc1JfM/video.html

  • @alexshel8578
    @alexshel8578 Před 2 lety

    can unreal engine 5 do something that Three.js can't do?
    This is a very serious question.)

    • @simondev758
      @simondev758  Před 2 lety +1

      These days you can do a lot in JS, but still doesn't hold a candle to UE5.

  • @StonyCodes
    @StonyCodes Před rokem

    Where did you learn programming?

    • @simondev758
      @simondev758  Před rokem

      Learned in University, degree in computer science, then just work/hobby to improve.

  • @br-zhou
    @br-zhou Před 2 lety

    imagine you add proximity voice chat...

  • @scottonanski4173
    @scottonanski4173 Před 2 lety +1

    You should make a video on how to interpret the ThreeJs documentation because it's really, really bad...

    • @simondev758
      @simondev758  Před 2 lety +1

      Heh, it's funny I never give that any thought, I've always found their docs had exactly what I was looking for. But there's definitely a gulf between "absolute basics" and "professional with years of experience". In a way, these videos are attempting to bridge that gap.

    • @scottonanski4173
      @scottonanski4173 Před 2 lety

      ​@@simondev758 Your videos are far beyond beginner level! lol
      I mainly watch them for inspiration; knowing what is one day possible if I keep smashing my face against JavaScript.
      On a good day I catch something I sort of understand.
      btw, the lighting in your scene looks absolutely amazing.
      And the 'bob' movement is very convincing!

  • @qxb348
    @qxb348 Před 2 lety +2

    first