importing_audio_samples.rst 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. .. _doc_importing_audio_samples:
  2. Importing audio samples
  3. =======================
  4. Why importing?
  5. --------------
  6. Raw audio data in general is large and undesired. Godot provides two main
  7. options to import your audio data: WAV and OGG Vorbis.
  8. Each has different advantages.
  9. * Wav files use raw data or light compression, require small amount of CPU to play back (hundreds of simultaneous voices in this format are fine), but take up significant space.
  10. * Ogg Vorbis files use a stronger compression that results in much smaller file size, but uses significantly more processor to play back.
  11. .. image:: img/audio_stream_import.png
  12. Here is a comparative chart.
  13. +-------------------------------+---------------------+
  14. | Format | 1 Second of Audio |
  15. +===============================+=====================+
  16. | WAV 24 bits, 96 kHz, Stereo | 576kb |
  17. +-------------------------------+---------------------+
  18. | WAV 16 bits, 44 kHz, Mono | 88kb |
  19. +-------------------------------+---------------------+
  20. | WAV 16 bits, IMA-ADPCM, Mono | 22kb |
  21. +-------------------------------+---------------------+
  22. | OGG 128kbps, Stereo | 16kb |
  23. +-------------------------------+---------------------+
  24. | OGG Vorbis 96kbps, Stereo | 12kb |
  25. +-------------------------------+---------------------+
  26. In general, what is recommended, is to use WAV for most sound effects, especially those that are short and repetitive, and OGG for music, voice and long sound effects.
  27. Best Practices
  28. --------------
  29. Godot 3+ has an amazing bus system with built in effects. This saves
  30. SFX artists the need to add reverb to the sound effects, reducing their
  31. size greatly and ensuring correct trimming. Say no to SFX with baked
  32. reverb!
  33. .. image:: img/reverb.png
  34. As you can see above, sound effects become huge with reverb added.
  35. Trimming
  36. ~~~~~~~~
  37. One issue that happens often is that the waveform are exported with long
  38. silences at the beginning and at the end. These are inserted by
  39. DAWs when saving to a waveform, increase their size unnecessarily and
  40. add latency to the moment they are played back.
  41. Importing as WAV with the Trimming option enabled solves
  42. this.
  43. Looping
  44. ~~~~~~~
  45. Godot supports looping in the samples (Tools such as Sound Forge or
  46. Audition can add loop points to wav files). This is useful for sound
  47. effects such as engines, machine guns, etc. Ping-pong looping is also
  48. supported.
  49. As an alternative, the import screen has a "loop" option that enables
  50. looping for the entire sample when importing.