Version: 2018.2
Ambisonic Audio
Audio Listener

Audio Clip

Аудио клипы (Audio Clips) содержат данные аудио, используемые в источниках аудио. Unity поддерживает моно, стерео и мультиканальные звуковые ассеты (до восьми каналов). Unity может импортировать следующие типы файлов: .aif, .wav, .mp3, and .ogg. Также, Unity может импортировать трекерные модули из следующих типов файлов: .xm, .mod, .it, and .s3m. Ассеты с трекерными модулями работают так же, как и любые другие аудио ассеты в Unity, правда для них недоступен просмотр формы сигнала в инспекторе импорта ассетов.

The Audio Clip inspector
The Audio Clip inspector

Опции

Force To Mono

When this option is enabled, multi-channel audio will be mixed down to a mono track before packing.

Normalize

When this option is enabled, audio will be normalized during the “Force To Mono” mixing down process.

Load In Background

When this option is enabled, the loading of the clip will happen at a delayed time on a separate thread, without blocking the main thread.

Ambisonic

Ambisonic audio sources store audio in a format which represents a soundfield that can be rotated based on the listener’s orientation. It is useful for 360-degree videos and XR applications. Enable this option if your audio file contains Ambisonic-encoded audio.

Свойства

Свойство: Функция:
Load Type Метод загрузки аудио ассетов во время работы приложения, используемый Unity.
Decompress On Load Распаковывать аудио файлы сразу же после загрузки. Используйте эту опцию для маленьких сжатых звуков, чтобы избежать чрезмерного потребления ресурсов из-за распаковки “на лету”. Учтите, что распаковка файлов после загрузки занимает примерно в десять раз больше памяти по сравнению с их размером в сжатом виде, поэтому не используйте эту опцию для больших файлов.
Compressed In Memory Сохранять звуки в памяти в сжатом виде и распаковывать при проигрывании. Эта опция не сильно сказывается на производительности (особенно для сжатых файлов Ogg/Vorbis), поэтому используйте её только для больших файлов, на которых распаковка при загрузке потребляла бы слишком много памяти. Заметьте, что из-за технических ограничений, эта опция автоматически переключается на Stream From Disc (см. описание ниже) для Ogg Vorbis ассетов на платформах, которые используют FMOD аудио.
Streaming Decode sounds on the fly. This method uses a minimal amount of memory to buffer compressed data that is incrementally read from the disk and decoded on the fly. Note that decompression happens on the separate streaming thread whose CPU usage can be monitored in the “Streaming CPU” section in the audio pane of the profiler window. Note: Streaming clips has an overload of approximately 200KB, even if none of the audio data is loaded.
Compression Format Формат звука, который будет использован при проигрывании во время работы приложения.
PCM Это нативный формат. Он является наиболее качественным, но и производит файлы большего размера, поэтому лучше всего использовать его для очень коротких аудио эффектов.
ADPCM This format is useful for sounds that contain a fair bit of noise and need to be played in large quantities, such as footsteps, impacts, weapons. The compression ratio is 3.5 times smaller than PCM, but CPU usage is much lower than the MP3/Vorbis formats which makes it the preferrable choice for the aforementioned categories of sounds.
Vorbis/MP3 Это сжатый формат. Сжатие приводит к меньшему размеру файлов, но с некоторыми потерями в качестве звука по сравнению с нативным форматом. Данный формат лучше всего использовать для звуков средней длины и для музыки.
HEVAG This is the native format used on PS Vita. The specs of this are very similar to those of the ADPCM format.
Sample Rate Setting PCM and ADPCM compression formats allow automatically optimized or manual sample rate reduction.
Preserve Sample Rate This setting keeps the sample rate unmodified (default).
Optimize Sample Rate This setting automatically optimizes the sample rate according to the highest frequency content analyzed.
Override Sample Rate This setting allows manual overriding of the sample rate, so effectively this may be used to discard frequency content.
Force To Mono If enabled, the audio clip will be down-mixed to a single channel sound. After the down-mixing the signal is peak-normalized, because the down-mixing process typically results in signals that are more quiet than the original, hence the peak-normalized signal gives better headroom for later adjustments via the volume property of AudioSource
Load In Background If enabled, the audio clip will be loading in the background without causing stalls on the main thread. This is off by default in order to ensure the standard Unity behavior where all AudioClips have finished loading when the scene starts playing. Note that play requests on AudioClips that are still loading in the background will be deferred until the clip is done loading. The load state can be queried via the AudioClip.loadState property.
Preload Audio Data If enabled, the audio clip will be pre-loaded when the scene is loaded. This is on by default to reflect standard Unity behavior where all AudioClips have finished loading when the scene starts playing. If this flag is not set, the audio data will either be loaded on the first AudioSource.Play()/AudioSource.PlayOneShot(), or it can be loaded via AudioSource.LoadAudioData() and unloaded again via AudioSource.UnloadAudioData().
Quality Уровень сжатия, применяемый к Сжатому клипу. Расчётный размер файла можно посмотреть под слайдером. Лучше всего настроить это значение (с помощью ползунка слайдера) так, чтобы качество звучания оставалось на приемлемом уровне и при этом размер файла соответствовал вашим требованиям.

Окно Preview

Окно Preview содержит три иконки.

Turn Auto Play On/Off When Auto Play is on the clips will play as soon as they are selected.

Turn Loop On/Off When Loop is on the clips will play in a continual loop.

Play This will play the clip.

Импортирование аудио ассетов

Unity is able to read a wide range of source file formats. Whenever a file is imported, it will be transcoded to a format suitable for the build target and the type of sound. This is selectable via the Compression Format setting in the inspector.

In general, the PCM and Vorbis/MP3 formats are preferrable for keeping the sound as close to the original as possible. PCM is very lightweight on the CPU requirements, since the sound is uncompressed and can just be read from memory. Vorbis/MP3 allows adaptively discarding less audible information via the Quality slider.

ADPCM is a compromise between memory and CPU usage in that it uses only slightly more CPU than the uncompressed PCM option, but yields a constant 3.5 compression factor, which is in general about 3 times worse than the compression that can be achieved with Vorbis or MP3 compression. Furthermore ADPCM (like PCM) allows automatically optimized or manually set sample rates to be used, which – depending on the frequency content of the sound and the acceptable loss of quality – can further shrink the size of the packed sound assets.

Module files (.mod,.it,.s3m..xm) can deliver very high quality with an extremely low footprint. When using module files, unless you specifically want this, make sure that the Load Type is set to Compressed In Memory, because if it’s set to Decompress On Load the whole song will be decompressed. This is a new behavior in Unity 5.0 that allows GetData/SetData to be used on these types of clips too, but the general and default use case for tracker modules is to have them compressed in memory.

Как правило, Compressed аудио (или модульные звуки) лучше всего использовать для длинных файлов, например, для фоновой музыки или диалога, в то время как Native формат лучше подходит для коротких звуковых эффектов. Следует подбирать степень сжатия с помощью слайдера Compression. Начните с высокой степени сжатия и постепенно уменьшайте её до уровня, когда потеря качества уже заметна. После этого начните понемногу увеличивать обратно степень сжатия до тех пор, пока заметная на слух потеря качества не пропадёт.

Специфичная для платформ информация

Unity supports importing a variety of source format sound files. However when importing these files (with the exception of tracker files), they are always re-encoded to the build target format. By default, this format is Vorbis, though this can be overridden per platform to other formats (ADPCM, MP3 etc) if required.


  • 2017–08–09 Page published with no editorial review

  • Ambisonic support checkbox added in Unity 2017.1 NewIn20171

Ambisonic Audio
Audio Listener
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961