# FMOD sound backend improvements: spatial sounds, priority, distance model, offset

**URL:** https://forum.castle-engine.io/t/fmod-sound-backend-improvements-spatial-sounds-priority-distance-model-offset/424
**Category:** News
**Created:** [September 25, 2021, 2:05pm UTC](https://forum.castle-engine.io/t/fmod-sound-backend-improvements-spatial-sounds-priority-distance-model-offset/424 "2021-09-25T14:05:02Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)
#### Post date: [September 25, 2021, 2:05pm UTC](https://forum.castle-engine.io/t/fmod-sound-backend-improvements-spatial-sounds-priority-distance-model-offset/424/1 "2021-09-25T14:05:03Z")

</div>

| [![FMOD logo](https://castle-engine.io/wp/wp-content/uploads/2021/09/unholy_society_screen_15-200x113.png)](https://castle-engine.io/wp/wp-content/uploads/2021/09/unholy_society_screen_15.png "FMOD logo") |

Our [FMOD sound backend](https://github.com/castle-engine/castle-engine/wiki/FMOD), that integrates CGE with the [FMOD sound system](https://www.fmod.com/), supports now 3D (spatial) sounds. This means that sound position in 3D is reflected in your ears — things that are closer are louder, things that are on your right are mostly in your right speakers etc.

The improvements outlined here make our [FMOD sound backend](https://github.com/castle-engine/castle-engine/wiki/FMOD) at par (the same features, with the same CGE API) with our default _OpenAL sound backend_. This matters, as it opens the door for future integration with [FMOD Studio](https://www.fmod.com/studio). The goal of _FMOD Studio_ is to make the work of _sound designer_ easier. The sfx person can create sound effects in _FMOD Studio_, in a way that is agnostic to the game engine, and the code (like your game) simply sends _“events”_ that may cause some sound effect (playing something, stopping something, fading in/out something…).

Note: _OpenAL_ remains our default sound backend, as an open-source audio library, for our open-source game engine. The [FMOD backend](https://github.com/castle-engine/castle-engine/wiki/FMOD) is just an option — when you are OK with using proprietary and [commercial (though free in some cases, for indie devs)](https://www.fmod.com/licensing) solution, in exchange for features like _FMOD Studio_ and [Nintendo Switch compatibility](https://github.com/castle-engine/castle-engine/wiki/Nintendo-Switch).

Our FMOD support improvements are:

- 

- The [SoundEngine.DistanceModel](https://castle-engine.io/apidoc-unstable/html/CastleSoundEngine.TSoundEngine.html#DistanceModel) is supported by FMOD (so you can change the distance model to _“linear”_ if desired; default is equivalent to FMOD default, _“inverse”_).

- The [TCastlePlayingSound.Offset](https://castle-engine.io/apidoc-unstable/html/CastleSoundEngine.TCastlePlayingSound.html#Offset) (reading and setting) works with FMOD. 

- Sound priority is now passed to FMOD in a more straightforward way, to allow FMOD to manage sound sources. 

- Internal example moved to [examples/audio/internal/fmod\_api\_test/](https://github.com/castle-engine/castle-engine/tree/master/examples/audio/internal/fmod_api_test) . This is a useful example for people that want to work directly with FMOD or extend our FMOD backend in CGE. It should not be followed by normal CGE users.

There’s no new CGE API to present here. Just use the existing classes like [`TCastleSoundSource` and `TCastleSound` (see previous news post, about sound API upgrades)](https://castle-engine.io/wp/2021/09/24/new-sound-api-easier-to-use-more-versatile-and-ability-to-set-up-sounds-using-cge-editor/). They will work with FMOD backend as you expect, producing 3D sound.
