Lately I have been experimenting with runtime generated soundscapes. I’m building a system that uses a bunch of small audio clips and plays them in a randomized but controlled way.
Being a sound designer as well as a programmer (have been working on both sides of the fence), I’m fully aware that sound is not the highest priority in the development process. The audio can in most cases be stitched on right at the end without any major impact on playtesting etc. (Graphics and code cannot.) At the end of a project it is not uncommon that there is too little time, money and energy for any ambitious audio design.
What I’m thinking is that it could sometimes be useful to have a small, lightweight, fully designed, customizable soundscape that can be added to a project with minimal effort. Maybe for a prototype, maybe to deliberately support a longer portion of the game or maybe for a last "oops we need audio”. That was my motivation for this project anyway.
This thing is available on the Asset Store now, and I’ll probably make a few more soundscapes like this later. Perhaps a sci-fi environment and maybe some horror stuff.
This looks like a very interesting approach to background audio. Any script runtime documentation available to peruse? I imagine most games, like mine, may require the ability to switch between different soundscapes at runtime.
In addition, have you considered perhaps allowing users the ability to take a master audio track (like an already existing music/ambient track) and layering new effects on it using your system to make it more dynamic?
I went for ease of use over flexibility with this one. The limited character customization system in for example WoW has been an inspiration. In that game I’m fully happy to have the graphical bounds set by people who know what they are doing. I don’t want to be able to fine tune the width of the nose or the height of the eyebrows, simply because I can’t do it good enough to even be happy with it myself. I appreciate any help I can get and I figure the same goes for audio for some people.
On the other hand, for those who really know what they are doing there are already a number of good assets for managing audio on the asset store. One can even choose to integrate FMOD, which is pure gold in my opinion and free for indies now. Then, of course, you have to be prepared to do a bit of sound design yourself and some coding.
Enchanted Forest is on the other side of the spectrum - a predesigned soundscape, only somewhat customizable (but impossible to make it sound bad) and with no coding required.
(To answer your question: Yes you actually can change them, but it is not a documented feature.)
Except for the parameters that are obvious from the demo, there are three public functions:
Play() // Starts the soundscape
Stop() // Ends the soundscape gracefully. No new sounds will start playing. The sounds already playing will finish.
Kill() // Abruptly stops all sounds.
I should put this in an FAQ.
You can run any other audio in parallell with this. Just play it as usual with the Unity API. You can mute the musical elements of the Enchanted Forest by setting the Fairy Dust parameter to zero. (You can even rip that whole module out of the prefab if you want to. It is easily done, although not documented.)
More stuff for the FAQ. I did some profiling. I don’t have the numbers right now, but they were more or less off the charts on the cheap side. Unity 4.5 is supposed to have an improved audio profiler and I will come back to you on this one.
I just discovered that there is a bug in Unity 4.5 that won’t allow the same audio clip to be played by multiple audio sources at the same time. Until that bug is fixed, this asset will be completely useless… I was going to check out the new profiler today, but I guess I will have to wait a bit.