importing_audio_samples.rst 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. .. _doc_importing_audio_samples:
  2. Importing audio samples
  3. =======================
  4. Why import?
  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, make few demands on the 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 require significantly more processing power 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. Consider using WAV for short and repetitive sound effects, and OGG
  27. for music, speech, and long sound effects.
  28. Best practices
  29. --------------
  30. Godot 3+ has an amazing bus system with built-in effects. This saves
  31. SFX artists the need to add reverb to the sound effects, reducing their
  32. size greatly and ensuring correct trimming. Say no to SFX with baked
  33. reverb!
  34. .. image:: img/reverb.png
  35. As you can see above, sound effects become huge with reverb added.
  36. Trimming
  37. ~~~~~~~~
  38. One issue that happens often is that the waveform is exported with long
  39. silences at the beginning and at the end. These are inserted by
  40. DAWs when saving to a waveform, increase their size unnecessarily and
  41. add latency to the moment they are played back.
  42. Importing as WAV with the Trimming option enabled solves
  43. this.
  44. Looping
  45. ~~~~~~~
  46. Godot supports looping in the samples (tools such as Sound Forge or
  47. Audition can add loop points to wav files). This is useful for sound
  48. effects, such as engines, machine guns etc. Ping-pong looping is also
  49. supported.
  50. As an alternative, the import screen has a "loop" option that enables
  51. looping for the entire sample when importing.