Audio formats

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By vonflyhighace2
:warning: Old Version Published before Godot 3 was released.

I was Initially searching for support for uncompressed of loss-less codecs for some audio fx. I only came across the few that are there by default. What are the advantages of each audio format that the engine supports. I get OGG Vorbis, but MPC, OPus, Speex? I did a search to see what each entail but came up with ogg being a container for all these codecs and there all lossy types. Does anyone use these formats? if so for what exactly?

:bust_in_silhouette: Reply From: Calinou

Godot does not support any loss-less compressed format like FLAC because those are inconvenient for games, due to their significant CPU usage required for decoding, as well as their file size.

For music, you can still use the Opus format (which usually carries the .opus extension), which is an high-quality lossy compressed format.

For most game sounds (which should be samples, not streams), the only choice is the .wav format which is uncompressed, to minimize CPU usage. You can use a low-quality compressed format too (Ima-ADPCM), but the compression will be noticeable to good ears.

I’m not sold yet by the decision to deliberately restrict game sounds to WAV in Godot engine, or maybe I didn’t tinkered enough with audio import.

Before using Godot I shipped games with all sounds in .ogg (sometimes there are many), and it contributed to reduce their size a LOT. It also benefits web based games because they load faster. Game sounds set as “not streamed” are fully loaded as uncompressed samples in memory, so playback performance and quality is still good.
I’m not saying everyone should use OGG, but we could have the choice, because every game has different needs.

Also, I have Unity3D background and it allowed just any audio format to use in projects. Streaming or compressing or not was just an option, whatever source format they are. It’s handy because we spend less time importing stuff and more focus on how we play them in game :slight_smile: (I guess their import pipeline plays a role here, behind the scenes)

Side note: we can use PNG. Why can’t we use FLAC? It’s the audio equivalent :stuck_out_tongue:

Zylann | 2016-04-13 16:58

I’m totally agree with Zylann.
I ‘just’ want use wav bmp avi mpg and godot supports anything

eaglecat | 2016-06-06 10:56