Friday, 18 March 2011

Applying Sound

Since the last post about sound I've gone searching and have collected Sound FX for Fire, Water and walking. These sound effects were found from the website "Find Sounds". The SFX that I got were pretty good but the problem is that they were just clips, what I need is a sound that can loop as seamlessly as possible. From there I opened up the Program "Audacity" which allows me to select parts of an audio clip and export them as a new clip. After spending time figuring out a good Place where each sample can loop and exporting them as new SFX it was time to applying them into Unity along with my soundtrack. It should be noted that each file is recorded under the wav format as this takes up less space than other file formats without much loss to quality.

To import a sound into Unity the process is relatively uncomplicated. By importing the wav files as assests I then create an empty game object to apply the sound to.
When doing this You'll have various options in the right window such as 3D Sound, I turned this off as the sound interacts with the shape of the room rather than just playing and select the loop option. To create a walking sound with the FPS Prefab in Unity all thats require is to add the script found from my Uni's Moodle sight and adjust the settings to get the desired effect of walking.

When placing the sounds in the room I experimented with the places they could go. Creating duplicates of the sound boxes and putting each fire sound by the fire particles proved to be overpowering due to the combined volume of the 3 sound boxes. Knowing this I stuck to one sound box per SFX and placed them in the room the cover the areas in which they play. For example the fire sound box is between the chair and two lanterns as that's the area it needs to cover and the water Sound box is places between the two gargoyles.

Finally applying script to my game music was a challenge. The effect I wanted to achieve was that when the player character reaches a certain point (where the collider box begins) the Ambient Back ground Music would change to the battle theme, I tried to figure it out but my understanding of script is limited. Luckily my Tutor helped me and this is the script to the right, basically telling the computer when the character enters the collider box the music will change and then revert back once the player leaves the box.

After placing and applying my sounds to all the correct objects I went about adjusting the volume levels so that effect such as the water and fire won't overpower the soundtrack.

With that done all that's left is to import my character!

No comments:

Post a Comment