FMOD & Unity | First Person Audio Occlusion

  Рет қаралды 13,792

Scott Game Sounds

Scott Game Sounds

Күн бұрын

Пікірлер: 69
@emanueleferrari156
@emanueleferrari156 4 жыл бұрын
I love this video and I strongly suggest your course to all who will read this comment! Finally someone who explain the things in a real context. Starting from this video I'm working on my occlusion script, I've a lot of free time while I'm furlough. I'm trying to script something that can move the sound on a virtual position and allow sound gates but less expensive (and fancy) than steam audio. Thanks for all your efforts mate.
@ScottGameSounds
@ScottGameSounds 4 жыл бұрын
Hey Emanuele! Thanks so much for those kind words! Your comment really means a lot! Awesome to hear that you're using this to develop your own scripts. Good luck with the sound gates part. I've tried making those myself in the past and they can be very tricky. Looking forward to hearing how you get on with them.
@themuffindragon
@themuffindragon 4 жыл бұрын
Awesome tutorial! I loved the in depth explanation of how the script works. I'm pretty new to FMOD and learned a lot. Obviously it probably could have been cut down a little bit but it was very informative all the same.
@ScottGameSounds
@ScottGameSounds 4 жыл бұрын
Yeah kinda whet over board on this one hahaha, but I'm happy to hear that you found this video helpful Dragonite! I think it's one of my favourites
@MikeLCF
@MikeLCF 4 жыл бұрын
Just a small correction! When the direct sound is not obstructed, but you have obstrucions around it (obstructing mostly reflexions coming from the source room) is not OCCLUSION but EXCLUSION! Good work!
@ScottGameSounds
@ScottGameSounds 4 жыл бұрын
Yes, you're correct Lucas. Thanks for pointing that out. I wasn't aware there were different terms separating the differences until after I made this video. I hadn't even herd of OBSTRUCTION before, let alone EXCLUSION. I was just referring to it all as OCCLUSION haha. Thanks for the comment.
@MikeLCF
@MikeLCF 4 жыл бұрын
@@ScottGameSounds You did an awesome job! Thank for sharing! I just wanted to put that info there because if people know the terms it's easier to research =)
@rickveldkamp4217
@rickveldkamp4217 2 жыл бұрын
Absolutely love the videos! Mine's not working unfortunately, I'd love some help! I had to change some things to resolve some errors: Line 9: Obsolete [EventRef] replaced with: public FMODUnity.EventReference Event; Line 34 & 39: Had to manually set the events in the script by using the event path because SelectAudio wasn't working for me (because of the obsolete [EventRef]) Line 40: Had to change the outdated getMaximumDistance (out Maxdistance) to getMinMaxDistance (out float MinDistance, out float Maxdistance). Line 42: Had some problems with the Fmod studiolistener not being found, and getting a NullReferenceException as a result of that. This somehow resolved itself. The issue I'm having is that I cannot see any lines either in the gameview and sceneview, I imagine that's why it's not working, but I have no clue how to resolve the issue. I also do have some other scripts on the FPSController and FirstPersonCharacter GameObjects, but if I deactivate them nothing changes. So yeah, I'm lost. I'd owe my life to anyone who'd be able to help me. Update: I managed to get the lines to be cast, problem was line 51: somehow the listenerDistance
@tomstan3037
@tomstan3037 2 жыл бұрын
Hi ! Thanks for you updates! Did you find your problem with FixedUpdate ?😁
@jakobw.7405
@jakobw.7405 Жыл бұрын
getMinMaxDistance (out float MinDistance, out float Maxdistance) has to be without the float or a second "Maxdistance" variable is created. for me this line works: getMinMaxDistance(out float MinDistance, out MaxDistance); also leave the " listenerDistance
@hvarv
@hvarv 6 ай бұрын
Hi Henry! Great video as always! Do you have a similar solution for Unreal Engine or any resources you can guide me to? Thanks a bunch for your tutorials!
@OrnateOwl
@OrnateOwl 4 жыл бұрын
You are so good at what you do! Put aside the fact that I was looking for exactly this specifically on Fmod, your explanation, your clarity, your experience, I love it all! Subfrigginscribed.
@ScottGameSounds
@ScottGameSounds 4 жыл бұрын
WOW Thanks so much! What an amzing compliment to receive. I think that's made my day! So happy to hear that you found this video helpful! I hope I can make more videos that are just as helpful to you!
@OrnateOwl
@OrnateOwl 4 жыл бұрын
Scott Game Sounds you already did make many such videos! I'm going on a marathon on your Fmod tutorials soon. Maybe will buy the course as well at some point. Big thank you for expanding our Unity + Fmod learning resources, friend.
@Injabsful
@Injabsful 11 ай бұрын
what about on top or beneath a player, like limiting if im in a second floor theres a source on third and first can you distinguish them ?
@drummsnikk5073
@drummsnikk5073 2 жыл бұрын
this is majestic.
@gregsmith80
@gregsmith80 2 жыл бұрын
Why are we working out the listener positions with congruent triangles and not just adding or subtracting the occlusion widening variable to the listener's position? I haven't tested this yet so I genuinely don't know if it will work, but I see no reason why it wouldn't. The sound source positions can be cached on awake as well (update the positions in the occlusionWidening variable's setter if you want it to be dynamic). Great video, though. Thanks!
@adrianguzman8093
@adrianguzman8093 3 жыл бұрын
Fantastic videos. Top tier content!
@ScottGameSounds
@ScottGameSounds 3 жыл бұрын
Wow what a great comment to read! Thanks a bunch Adrian!
@atokenbeast3927
@atokenbeast3927 2 жыл бұрын
you dont have a discord so i hope you answer it here, In the quantum break example they had a trace going from the emitter to the player but everything else went from the player to listener. First, why? Second, what was the center(yellow) line for(going from emitter to player)
@jacobvalenzuela2546
@jacobvalenzuela2546 2 жыл бұрын
I couldn't get it to work. I'm getting an error: Assets\FirstPersonOcclusion.cs(40,18): error CS1061: 'EventDescription' does not contain a definition for 'getMaximumDistance' and no accessible extension method 'getMaximumDistance' accepting a first argument of type 'EventDescription' could be found (are you missing a using directive or an assembly reference?)
@MotionMenace2
@MotionMenace2 2 жыл бұрын
Im getting this too, not sure how to fix it.
@jakobw.7405
@jakobw.7405 2 жыл бұрын
same issue
@VKametlik
@VKametlik 2 жыл бұрын
Anyone found a solution? I'm running into the same problem. Using FMOD 2.02, could that be the root of the issue maybe?
@MotionMenace2
@MotionMenace2 2 жыл бұрын
@@VKametlik i ended up implementing steam audio instead. How ever be careful, using the real time reverb with either fmod 2.02 or my unity version 2020.327f it crashes. Occlusion and everything else is working as intended it seems :) Steam audio is the shit, look into it!
@VKametlik
@VKametlik 2 жыл бұрын
@@MotionMenace2 awesome thank you 🙏 I'll be sure to look into that! Appreciate it
@TungNguyen-rk1pf
@TungNguyen-rk1pf Жыл бұрын
tks man, its really help me
@ManaforceStudios
@ManaforceStudios 3 жыл бұрын
Wouldn't this be very resource intensive in a fully built game?
@Xiaoxiao738
@Xiaoxiao738 4 жыл бұрын
OMG Face Reveal!
@ScottGameSounds
@ScottGameSounds 4 жыл бұрын
Yep! New year, new facecam!
@handsomelessking
@handsomelessking 9 күн бұрын
Heey, first of all amazing code, if you dont mind i converted it to work in unity's default audio system (was pain to make Reverb Filter work like a float), and can i release the code on github?
@MaximeLennoz
@MaximeLennoz 4 жыл бұрын
A great Thank You from france !!!
@ScottGameSounds
@ScottGameSounds 4 жыл бұрын
Aw, thanks a lot Maxime! You're very welcome from England!
@WangleLine
@WangleLine 4 жыл бұрын
Oh hey, that facecam is new!
@ScottGameSounds
@ScottGameSounds 4 жыл бұрын
Yep. A christmas present I'm trying out.
@mf813
@mf813 4 жыл бұрын
Thank you man! it's work!
@ScottGameSounds
@ScottGameSounds 4 жыл бұрын
Ah wicked! Great to hear mf813. Thank you for your comment, and hope you enjoyed the vid :)
@AlicaKnirsch
@AlicaKnirsch Жыл бұрын
when i Use this Script in JetBrain Riders, the Line 42 "getMaximumDistance" is marked as an error. I dont know exactly why and how to fix it. If somebody knows pls help :)
@angusmccall3400
@angusmccall3400 Жыл бұрын
Replace the whole line with "AudioDes.getMinMaxDistance(out float MinDistance, out float Maxdistance);"(credit to Rick Veldkamp)
@laurena227
@laurena227 4 жыл бұрын
Great stuff!:D
@ScottGameSounds
@ScottGameSounds 4 жыл бұрын
Thanks a lot Cainapp1e!
@oscarcorral1428
@oscarcorral1428 4 жыл бұрын
Phenomenal!
@ScottGameSounds
@ScottGameSounds 4 жыл бұрын
Awesome! Glad you think so Oscar
@emmetwhite2153
@emmetwhite2153 4 жыл бұрын
Hi, I'm running into a problem and can't seem to get this to work. I'm not seeing the lines cast in the editor view for starters and even with adding the "Occlusion" parameter in FMOD I'm not achieving the result of the sound being occluded at all. Any help? Really enjoying the videos and they are going a long way to getting me informed in this realm.
@emmetwhite2153
@emmetwhite2153 4 жыл бұрын
Seem to worked out the problem. I didn't have the obstructing object have a rigidbody component
@ScottGameSounds
@ScottGameSounds 4 жыл бұрын
Great to hear Emmet! Thanks a lot for your nice comment :)
@SoundQuest_SD
@SoundQuest_SD 3 жыл бұрын
you're the best! ;)
@ScottGameSounds
@ScottGameSounds 3 жыл бұрын
No you're the best!
@hankvananhalt7503
@hankvananhalt7503 3 жыл бұрын
Hello Scott, Really good explanation, it helps me alot with my current project. I need to seperate the ears/channels of the fmod listener and therefore it is necessary to implement two listener. You mentioned to just add this script to every sound emitting object und check the listener index (this value is assigned automatically in Fmod 2.00+). private StudioListener Listener will contain multiple Listeners, so i needs to be an array, right? Then, how I do access a specific listener inside the Listener Array for the different listener distances? Thank You for Your help, good work!
@hankvananhalt7503
@hankvananhalt7503 3 жыл бұрын
Got it to work. Simply declare the listeners as an generic List and assign Listener = FMODUnity.RuntimeManager.Listeners; in start(). Then set ListenerDistance of Listener[0] and Listener[1] (in case you use two listener).
@ScottGameSounds
@ScottGameSounds 3 жыл бұрын
Oh wow so you've managed to set this up for two differetn l;isteners? That's wicked! I didn't even know how to do that! That could be so useful for multiplayer games. Thanks a bunch for sharing Maximilian and sorry for the late reply to your comment.
@hankvananhalt7503
@hankvananhalt7503 3 жыл бұрын
@@ScottGameSounds correct, I use your script for two listeners. Just grab the List of Studio Listeners, that fmods runtimemanager creates when using various fmod listener in unity. Fmod automatically assign an index to every present fmod listener. this index can be used to access the different listeners within your script. Also, I managed to kind of separate the two listeners in left and right ear. By default, every listener got two ears (like a stereo mic). Two Listeners would simulate 4 ears, so I pan the sound source hard left or right by checking which listener index/ which ear is in the emitting area of the sound object.
@ScottGameSounds
@ScottGameSounds 3 жыл бұрын
@@hankvananhalt7503 damn that's so cool. Thanks Maximilian, I really appreciate you sharing that with me! If I make a video about multiple listeners I'll be sure to shout your name out. Hope you come up with some more cool ideas in the future!
@jackchen2193
@jackchen2193 2 жыл бұрын
cool man
@chadfranklin47
@chadfranklin47 4 жыл бұрын
Who is snoring in the background?
@ScottGameSounds
@ScottGameSounds 4 жыл бұрын
hahaha that's my dog Vinny. He's a french bulldog with very narrow nostrils so he snores louder than I do.
@chadfranklin47
@chadfranklin47 4 жыл бұрын
@@ScottGameSounds Lol. Thanks for the tutorials :)
@SubjektDelta
@SubjektDelta 2 жыл бұрын
if you do not want to do all this work... use steam audio for fmod and unity.
@djwaterduck9190
@djwaterduck9190 2 жыл бұрын
I wish it was that easy, but FMOD and steam audio doesn't mesh well imo, the reliance on the event emitter for every sound, as well as not being allowed to ever stop the emitter is just a hassle. It's a bit rough and hampers my workflow.
@SubjektDelta
@SubjektDelta 2 жыл бұрын
@@djwaterduck9190 sure it's a bit rough but it also works amazingly well. Just keep their documentations open and you'll figure out how easy it actually is. It's a tool, just learn to use it!
@djwaterduck9190
@djwaterduck9190 2 жыл бұрын
@@SubjektDelta Warning, wall of text that no one asked for: Of course, don't get me wrong, I have gone through the documentation, I do believe I have it down how it all works, as I have made every example of theirs work. I think some of the problems I have are connected to being a third person game, for example, 2D player sounds that I want to be diegetic and use reflections, but if I want reflections to work on a sound, it obviously needs the steam spatializer, which makes the sounds 3D (again obviously). Since my listener is on the player, but pans with the camera though, it will pan the sounds that are on the listener as well, which I rather not as it gets messy. Unlike the standard spatializer, I can't find a control for panning either as to disable it completely. Having to use an emitter for every sound becomes a bit of a hassle. If I have multiple sounds in a script, wanting to avoid each sound having it's own script, the only solution I found was to make a child with an event emitter for every sound, reference them all in one script and so on. A bit ugly, but it would work all the same. But since emitters only have 1 instance attached, what if I want more instances to play on top of each other? With only 1 emitter, the event would always restart if a sound is played in rapid fashion. So I need extra emitters now, just to play multiple instances of 1 sound, and some sort of sequence in the code to play the first emitter, then if triggered again, play a second one and so on. Even messier, even if it works. I'd so much rather be able to just create instances in code as usual. I have other struggles as well. But the absolute reliance on the event emitter and the issues therein, and the fact that I can't disable the emitter without also disabling steam audio functionality like reflections and occlusion on that source for the rest of session. I just wish the steam audio plugin meshed better with how to do things in FMOD usually. I also find reflections to be a bit wonky sometimes, bouncing a sound around so much I can hear it more than double the distance of the attenuation. Probably with more experimenting, and using it differently, I'd get that to work how I want though. Same with occlusion, it's great and all, automatic occlusion, hurrah! But it can cut very sharply just going around the corner of a wall, implementing it on my own I could ensure it would fade in FMOD, making it a bit less rough at times. That said, if I got the rest to work well, I wouldn't mind most of the time. Haven't had too much time to mess around admittedly, and I gotta move on soon (for now at least), but I just feel like I have more success at the moment using my own solutions. Seeing as you have used it yourself, maybe I am just completely lost and you have found way better solutions than me. But for now, while steam audio reflections and occlusion are cool, all these workarounds to get it to work like I want, and then barely or just missing the mark, I'd kinda rather not. :/ Really cool tech, especially being free and all though!
@gladiumcaeli
@gladiumcaeli 4 жыл бұрын
Nice
@ScottGameSounds
@ScottGameSounds 4 жыл бұрын
I KNOW RIGHT!!!
Lessons Learned from a Decade of Audio Programming
26:14
GDC 2025
Рет қаралды 133 М.
快乐总是短暂的!😂 #搞笑夫妻 #爱美食爱生活 #搞笑达人
00:14
朱大帅and依美姐
Рет қаралды 9 МЛН
МЕНЯ УКУСИЛ ПАУК #shorts
00:23
Паша Осадчий
Рет қаралды 4,5 МЛН
Spatial Audio in 'Budget Cuts': A VR Stealth Game
35:56
GDC 2025
Рет қаралды 5 М.
C Programming Tutorial for Beginners
3:46:13
freeCodeCamp.org
Рет қаралды 14 МЛН
FMOD 2.0 & Unity | How To Implement Parameters
31:55
Scott Game Sounds
Рет қаралды 17 М.
Coding Adventure: Ray Tracing
37:58
Sebastian Lague
Рет қаралды 1,2 МЛН
What are AI Agents?
12:29
IBM Technology
Рет қаралды 658 М.
3D Environment MasterClass VOL. 3 | DETAIL is Photorealism
3:58:56
pwnisher
Рет қаралды 1,2 МЛН
How Ray Tracing (Modern CGI) Works And How To Do It 600x Faster
32:06
Josh's Channel
Рет қаралды 580 М.