[OPEN SOURCE] PhysSound Physics Audio System

This package is now open source (under the MIT license).

You can grab the unitypackage file off Google Drive.

6 Likes

And there I was about to create something similar for my current project :slight_smile:
So thanks a lot for this. It looks (and sounds) great!
Just bought it.

Cheers!

Can it do rolling sounds for a ball, getting louder with increasing speed?

1 Like

Yes, it can achieve that effect. However, I will say that under the hood the sound wouldn’t actually be based on the angular velocity of the ball. There’s currently no distinction in this system between a ball sliding across a surface and a ball rolling across a surface, but both will produce sounds that will get louder with speed.

This is a feature I have considered adding, but I decided to hold off on adding it until I got the asset approved. (Updates to assets already on the asset store seem to take much less time than submitting a new asset).

1 Like

Looks great, think it could be tied together with Oculus Rift’s 3D audio?

Cool one

Nice. Bookmarked. :sunglasses:

Hey guys,
First off I want to thank you all for your inspiring words, it really means a lot!

Secondly I would like to share a little sneak peak of a new feature I am currently working on: Custom Sound Sets (forgive me for the bad looking editor)

Basically, these act as an override to the default Hard and Soft sound sets, allowing you to define a separate set of sounds for interactions between specific materials. So you can use this if you have a few special cases that you want to play different sounds for, or I guess if you want a very high amount of realism for your sounds :).


Edit:
Well, as I’ve been implementing this feature I’ve begun to realize that, with this current system, implementing something like this is way more dirty than I had anticipated. So with that said, a major rewrite of this system may be incoming. I’ll keep this thread posted on any updates of course!

Im really enjoying this! How can i make these 3D enabled? They are just as loud far away, unless it should be working…using unity’s 3D audio.

Hey HeadTrip,
You may have to mess with the settings on your AudioSources. Make sure that the ‘Spatial Blend’ property of your audio source is set to all the way to 3D and not 2D. You may also want to change the falloff curve under 3D sound settings if you are still having issues.

Cool thanks, must be a setup issue…will look at it soon.

BTW, your tool can be a very useful Foot Step Audio engine?.

I’m curious if it uses some sort of procedural sounds or just clips with varied volume/pitch?

It only uses the standard audio clips and audio sources. Basically it uses a collision’s velocity to select an audio clip from a list and plays that clip. It also adjusts the volume and pitch of the audio source each time a sound is played to prevent the sounds from being repetitive.

Well, I suppose it could be with a bit of interesting scripting, but it’s not really intended to do that.

Ok, well that seems cool, thanks for the quick response!

ahh nice, that did it… the slider from 2D to 3D. also, adding the 3D audio for the Rift works as well :slight_smile:

I am having issues with some physics objects that need to be really slammed against the ground to trigger audio, any suggestions? The player is holding an object and smashing it against the ground… you have to slam really hard to hear it, but then with attempts after you don’t need to. It’s like it needs to woken up.
Thanks

Hey,
That’s a bit weird… Maybe try lowering the Min value under Relative Velocity Threshold in your PhysSoundMaterial asset. if that doesn’t work then I may need a video or something so I can see exactly what is happening.

Sounds very interesting (pun not intended :smile:)!
Reading from the documentation it seems the system just select from collection of sound clips based on velocity and material right? There seems to be a bit of pitch manipulation thrown in to make it sound more realistic and random.

This actually reminds me of Jurassic Park Trespasser back in 1998!
A very little known ground breaking game that’s decade too advanced for its own good.
One of its most impressive feature is what the creator called “Real-Time Foley” system:

From Wiki:
"One of the most impressive features of Trespasser is a system dubbed by the creators as “Real-Time Foley”. Theoretically, the Trespasser engine could produce the sound of any two objects colliding with one another at any speed or distance by dynamically mixing several sounds together on-the-fly."

From Gamasutra’s Jurassic Park Trespasser Post Mortem:
“Another major system for Trespasser was its audio system, which we described as “real time Foley” because of its ability to generate collision and scraping effects between differing sound materials in real time. Although the system could have used more sound material data, even with what it had it resulted in some wonderfully immersive sound effects which most other games do not duplicate - things like scraping a board down a concrete surface or hitting an oil barrel with a metal bat sound just about perfect. Since the system doesn’t simply play two sound effects but actually chooses from a group of samples and sets volumes based on the underlying physics collision, it sounds much more natural than most other audio systems currently used.”

I was hoping this is actually procedurally generating the sound in real-time. Perhaps in the future update? :smile:

There is a lot of research dedicated and being done in this area, particularly from Cornell University:
Sound Rendering for Physically Based Simulation

The Geometric Algorithms for Modeling, Motion, and Animation (GAMMA) group at the University of North Carolina at Chapel Hill (UNC) also dedicated a lot of their research into this area, they have a dedicated youtube channel:

One of the most impressive from GAMMA group:
Example-guided Physically-based Modal Sound Synthesis

Another one from a Japanese group:
Real-time Rendering of Aerodynamic Sound using Sound Textures based on Computational Fluid Dynamics (2003)
http://nis-ei.eng.hokudai.ac.jp/~doba/papers/aerodynamic_sound.pdf
http://nis-ei.eng.hokudai.ac.jp/~doba/anime/as/as.html (movies)

I will definitely pick this up for sure! :slight_smile:

1 Like

That is some really interesting stuff! I will admit that my system is definitely not as complex as those other systems, but consider me inspired!

As far as updates go, I have a pretty cool teaser to show regarding the potential rewrite I mentioned earlier:

This is the PhysSound Material Type editor. What this will do is allow you to define your own material types, rather than just having the hard-coded Hard and Soft types. You can then set the Material Type in your PhysSoundMaterial to any of the types you defined here, and create the audio sets for each material type. This will provide a lot more versatility and also make the code back-end a lot cleaner!

1 Like

Hello once again!

I have posted a couple teasers of PhysSound Version 2, but now I am very proud to announce its release!

Major Changes:

  • Completely revamped the major components, especially the PhysSound Materials and Objects.
  • Added the ability to define your own material types via the Material Type Editor.
  • Added the ability to add and remove audio sets.
  • Added a check box to automatically create Audio Sources on your PhysSound Objects based on a template.
  • Removed the hard-coded Hard and Soft material types and audio sets as they are no longer needed.
  • Removed the Sound Mode option as it is no longer needed.

VERY IMPORTANT: Unfortunately updating to this new version WILL cause you to lose some assignments such as the Hard and Soft Impact lists, the Sliding audio clips, and audio sources.

Here are all of the updated links (The links in the original post are updated as well):

Asset Store Link

Guide & Docs Link
http://www.roadturtlegames.com/?ddownload=571

Demo Link
http://www.roadturtlegames.com/?page_id=566

As always feedback is greatly appreciated and of course post any bugs you find and I will fix them promptly!

1 Like