Skip to content

Commit 29949cb

Browse files
authored
Merge pull request #533 from defold/sound-sample-rate
Updated notes about supported sound formats and sample rates
2 parents b681382 + 0a95956 commit 29949cb

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

docs/en/manuals/optimization-size.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,18 @@ A quick way to reduce the engine size is to remove functionality in the engine t
4545
The biggest wins in terms of asset size optimizations are usually gained by reducing the size of sounds and textures.
4646

4747
### Optimize sounds
48-
Defold supports .ogg and .wav files where .ogg is typically used for music and .wav for sound effects. Sounds must be 16-bit with a sampling rate of 44100 so any optimizations must be done on the sounds before encoding them. You can edit the sounds in an external sound editor software to reduce the quality or convert from .wav to .ogg. Also consider converting sounds from stereo to mono.
48+
Defold supports these formats:
49+
* .wav
50+
* .ogg
51+
* .opus
52+
53+
Sounds files must be using 16-bit samples.
54+
Our sound decoders will up/downscale sounds sample rates as needed for the current sound device.
55+
56+
Shorter sounds like sound effects are often compressed harder, whereas music files have less compression.
57+
No compression is done by Defold, so the developer will have to handle that specifically for each audio format.
58+
59+
You can edit the sounds in an external sound editor software (or command line using e.g. [ffmpeg](https://ffmpeg.org)) to reduce the quality or convert between formats. Also consider converting sounds from stereo to mono to further reduce the size of the content.
4960

5061
### Optimize textures
5162
You have several options when it comes to optimizing the textures used by your game, but the first thing to do is to check the size of the images that gets added to an atlas or used as a tilesource. You should never use a larger size on the images than is actually needed in your game. Importing large images and scaling them down to the appropriate size is a waste of texture memory and should be avoided. Start by adjusting the size of the images using external image editing software to the actual size needed in your game. For things such as background images it might also be ok to use a small image and scale it up to the desired size. Once you have the images down to the correct size and added to atlases or used in tilesources you also need to consider the size of the atlases themselves. The maximum atlas size that can be used varies between platforms and graphics hardware.

docs/en/manuals/sound.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The created component has a set of properties that should be set:
2424
![Select component](images/sound/sound_properties.png)
2525

2626
*Sound*
27-
: Should be set to a sound file in your project. The file should be in _Wave_ or _Ogg Vorbis_ format. Defold supports sound files saved at 16bit bit depth and with a sampling rate of 44100.
27+
: Should be set to a sound file in your project. The file should be in _Wave_, _Ogg Vorbis_ or _Ogg Opus_ format. Defold supports sound files saved at 16bit bit depth.
2828

2929
*Looping*
3030
: If checked the sound will play back in _Loopcount_ times or until explicitly stopped.

0 commit comments

Comments
 (0)