Skip to content

Commit 4fbfcc3

Browse files
authored
Merge pull request #11087 from DeeJayLSP/wav-improve
Modify Importing audio samples to be in pair with 4.4 documentation
2 parents 2d9fbdd + 5de74e9 commit 4fbfcc3

File tree

1 file changed

+43
-42
lines changed

1 file changed

+43
-42
lines changed

tutorials/assets_pipeline/importing_audio_samples.rst

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,15 @@ Godot provides 3 options to import your audio data: WAV, Ogg Vorbis and MP3.
1010

1111
Each format has different advantages:
1212

13-
- WAV files use raw data or light compression (IMA-ADPCM or QOA). Currently
14-
they can only be imported in raw format, but Godot allows compression after
15-
import. They are lightweight to play back on the CPU (hundreds of simultaneous
16-
voices in this format are fine). The downside is that they take up a lot of disk space.
17-
- Ogg Vorbis files use a stronger compression that results in much
18-
smaller file size, but require significantly more processing power to
19-
play back.
20-
- MP3 files use better compression than WAV with IMA-ADPCM or QOA, but worse
21-
than Ogg Vorbis. This means that an MP3 file with roughly equal quality to
22-
Ogg Vorbis will be significantly larger. On the bright side, MP3 requires
13+
- WAV files use raw data or light compression (IMA ADPCM or Quite OK Audio). Currently
14+
they can only be imported in raw format, but Godot allows compression after import.
15+
They are lightweight to play back on the CPU (hundreds of simultaneous voices
16+
in this format are fine). The downside is that they take up a lot of disk space.
17+
- Ogg Vorbis files use a stronger compression that results in much smaller file
18+
size, but require significantly more processing power to play back.
19+
- MP3 files use better compression than WAV with IMA ADPCM or Quite OK Audio, but
20+
worse than Ogg Vorbis. This means that an MP3 file with roughly equal quality
21+
to Ogg Vorbis will be significantly larger. On the bright side, MP3 requires
2322
less CPU usage to play back compared to Ogg Vorbis.
2423

2524
.. note::
@@ -30,23 +29,23 @@ Each format has different advantages:
3029
Here is a comparative chart representing the file size of 1 second of audio with
3130
each format:
3231

33-
+-----------------------------+-------------------+
34-
| Format | 1 second of audio |
35-
+=============================+===================+
36-
| WAV 24-bit, 96 kHz, stereo | 576 KB |
37-
+-----------------------------+-------------------+
38-
| WAV 16-bit, 44 kHz, mono | 88 KB |
39-
+-----------------------------+-------------------+
40-
| WAV IMA-ADPCM, 44 kHz, mono | 22 KB |
41-
+-----------------------------+-------------------+
42-
| WAV QOA, 44 kHz, mono | 17 KB |
43-
+-----------------------------+-------------------+
44-
| MP3 192 Kb/s, stereo | 24 KB |
45-
+-----------------------------+-------------------+
46-
| Ogg Vorbis 128 Kb/s, stereo | 16 KB |
47-
+-----------------------------+-------------------+
48-
| Ogg Vorbis 96 Kb/s, stereo | 12 KB |
49-
+-----------------------------+-------------------+
32+
+------------------------------+-------------------+
33+
| Format | 1 second of audio |
34+
+==============================+===================+
35+
| WAV 24-bit, 96 kHz, stereo | 576 KB |
36+
+------------------------------+-------------------+
37+
| WAV 16-bit, 44 kHz, mono | 88 KB |
38+
+------------------------------+-------------------+
39+
| WAV IMA ADPCM, 44 kHz, mono | 22 KB |
40+
+------------------------------+-------------------+
41+
| Quite OK Audio, 44 kHz, mono | 17 KB |
42+
+------------------------------+-------------------+
43+
| MP3 192 Kb/s, stereo | 24 KB |
44+
+------------------------------+-------------------+
45+
| Ogg Vorbis 128 Kb/s, stereo | 16 KB |
46+
+------------------------------+-------------------+
47+
| Ogg Vorbis 96 Kb/s, stereo | 12 KB |
48+
+------------------------------+-------------------+
5049

5150
Note that the MP3 and Ogg Vorbis figures can vary depending on the encoding
5251
type. The above figures use :abbr:`CBR (Constant Bit Rate)` encoding for
@@ -125,8 +124,8 @@ saving to a waveform, which increases their size unnecessarily and add latency
125124
to the moment they are played back.
126125

127126
Enabling **Trim** will automatically trim the beginning and end of the audio if
128-
it's lower than -50 dB *after* normalization (see **Edit > Normalize** below). A
129-
fade-in/fade-out period of 500 samples is also used during trimming to avoid
127+
it's lower than -50 dB *after* normalization (see **Edit > Normalize** below).
128+
A fade-in/fade-out period of 500 samples is also used during trimming to avoid
130129
audible pops.
131130

132131
Edit > Normalize
@@ -143,13 +142,15 @@ Unlike Ogg Vorbis and MP3, WAV files can contain metadata to indicate whether
143142
they're looping (in addition to loop points). By default, Godot will follow this
144143
metadata, but you can choose to apply a specific loop mode:
145144

145+
- **Detect from WAV:** Uses loop information from the WAV metadata.
146146
- **Disabled:** Don't loop audio, even if metadata indicates the file should be
147147
played back looping.
148-
- **Forward:** Standard audio looping.
149-
- **Ping-Pong:** Play audio forward until it's done playing, then play it
150-
backward and repeat. This is similar to mirrored texture repeat, but for
151-
audio.
152-
- **Backward:** Play audio in reverse and loop back to the end when done playing.
148+
- **Forward:** Standard audio looping. Plays the audio forward from the beginning
149+
to the loop end, then returns to the loop beginning and repeats.
150+
- **Ping-Pong:** Plays the audio forward until the loop end, then backwards to
151+
the loop beginning, repeating this cycle.
152+
- **Backward:** Plays the audio backwards from the loop end to the loop beginning,
153+
then repeats.
153154

154155
When choosing one of the **Forward**, **Ping-Pong** or **Backward** loop modes,
155156
loop points can also be defined to make only a specific part of the sound loop.
@@ -166,12 +167,12 @@ the end of the audio file if set to ``-1``.
166167
Compress > Mode
167168
---------------
168169

169-
Three compression modes can be chosen from for WAV files: **Disabled** (default),
170-
**RAM (Ima-ADPCM)**, or **QOA (Quite OK Audio)**. **RAM (Ima-ADPCM)** reduces
171-
file size and memory usage a little, at the cost of decreasing quality in an
172-
audible manner. **QOA (Quite OK Audio)** reduces file size a bit more than
173-
**RAM (Ima-ADPCM)** and the quality decrease is much less noticeable, at the
174-
cost of higher CPU usage (still much lower than MP3).
170+
Three compression modes can be chosen from for WAV files: **PCM (Uncompressed)**,
171+
**IMA ADPCM**, or **Quite OK Audio** (default). **IMA ADPCM** reduces file size
172+
and memory usage a little, at the cost of decreasing quality in an audible manner.
173+
**Quite OK Audio** reduces file size a bit more than **IMA ADPCM** and the quality
174+
decrease is much less noticeable, at the cost of slightly higher CPU usage (still
175+
much lower than MP3).
175176

176177
Ogg Vorbis and MP3 don't decrease quality as much and can provide greater file
177178
size reductions, at the cost of higher CPU usage during playback. This higher
@@ -265,8 +266,8 @@ music tracks).
265266
.. note::
266267

267268
Unlike WAV files, Ogg Vorbis and MP3 only support a "loop begin" loop point,
268-
not a "loop end" point. Looping can also be only be standard forward
269-
looping, not ping-pong or backward.
269+
not a "loop end" point. Looping can also be only be standard forward looping,
270+
not ping-pong or backward.
270271

271272
.. _doc_importing_audio_samples_best_practices:
272273

0 commit comments

Comments
 (0)