Import audio files

material

Import audio
Unity performance optimization

How to load audio

  1. Decompress On Load Decompress immediately after loading
  2. Compressed In Memory The sound is compressed in memory and decompressed during playback.
  3. Streaming decodes sound on the fly

Setting suggestions

Decompress On Load is suitable for small audio (200kb)
Compress In Memory is suitable for larger audio (more than 200kb)
Streaming is suitable for background music, loading without lag, saving memory, and there will be additional CPU overhead

audio compression format

  1. PCM audio quality is high and file memory is large
  2. ADPCM has higher compression capability than PCM, but the CPU usage is lower than Vorbis/MP3
  3. Vorbis/MP3 has strong compression capability and lower quality than PCM

Setting suggestions

PCM is suitable for sound effects with small memory.
ADPCM is suitable for a lot of noise and sounds that require a lot of playback (such as footsteps, impacts, weapon sounds).
Vorbis/MP3 is suitable for medium-length sound effects and music.

other

Sample Rate Setting can set the sampling rate and change the file size.
Vorbis/MP3 can set the Quality to adjust the audio quality.
Force To Mono. Set multi-channel to mono to reduce memory and disk usage.
It is recommended to use WAV format for the original audio file
to achieve a mute effect, and the AudioSource can be destroyed. Component to unload audio from memory

Guess you like

Origin blog.csdn.net/weixin_43796392/article/details/131283437