Thursday, 17 March 2011

Audio Assests Unity

Sounds

Unity features support for two types of audio: Uncompressed Audio or Ogg Vorbis. Any type of audio file you import into your project will be converted to one of these formats.
File Type Conversion
.AIFF Converted to uncompressed audio on import, best for short sound effects.
.WAV Converted to uncompressed audio on import, best for short sound effects.
.MP3 Converted to Ogg Vorbis on import, best for longer music tracks.
.OGG Compressed audio format, best for longer music tracks.
Import Settings

If you are importing a file that is not already compressed as Ogg Vorbis, you have a number of options in the Import Settings of the Audio Clip. Select the Audio Clip in the Project View and edit the options in the Import Setting section of the Inspector. Here, you can compress the Clip into Ogg Vorbis format, force it into Mono or Stereo playback, and tweak other options. There are positives and negatives for both Ogg Vorbis and uncompressed audio. Each has its own ideal usage scenarios, and you generally should not use either one exclusively.

Importing Audio Assets

Unity supports both Compressed and Uncompressed Audio. Any type of file except .mp3 will be initially imported as Uncompressed. MP3 and Compressed audio files must be decompressed by the CPU while the game is running, but are smaller in file size. Native formats have the benefit of being higher fidelity without increasing CPU taxation, but create much larger files.

As a general rule of thumb, Compressed audio is best for long files like background music or dialog, and uncompressed is better for short sound effects that are under two seconds. However...

If you are creating a web player game, you should Compress as much of your audio as possible. This will help you attain the smallest file size for webplayer downloads. If you tweak the amount of Compression, the difference in sound quality won't be noticeable.

Using 3D Audio

If an audio clip is marked as a 3D Sound then it will be played back to simulate its position in the game world's 3D space. 3D sounds simulate distance and location of sounds by fading volume and panning across speakers. Unity supports 3D audio, and any stereo or mono clip can be played back in 3D space. However, mono 3D sounds are the most common.

No comments:

Post a Comment