About Store Forum Documentation Contact



Post Reply 
Esenthel/Titan with FMOD intergration
Author Message
tipforeveryone Offline
Bronze Supporter

Post: #1
Esenthel/Titan with FMOD intergration
I have learnt how to intergrate FMOD into Esenthel. This might extend the engine ability in sound process. So that I write down my learn process here for everyone who want to do the same thing (example codes included and updated along side my learning curve)
---
Because it is hard to write stuff in thread editor, I leave the link to public notion link here, hope this help smile

https://cscdvmp.notion.site/How-to-imple...08ef?pvs=4
(This post was last modified: 08-04-2023 09:17 AM by tipforeveryone.)
08-04-2023 09:05 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Esenthel/Titan with FMOD intergration
Why would you need Fmod?
08-04-2023 10:29 AM
Find all posts by this user Quote this message in a reply
tipforeveryone Offline
Bronze Supporter

Post: #3
RE: Esenthel/Titan with FMOD intergration
Requested by modders who use fmod studio to create their sound collection. It helps implement sound effects via banks which are built by fmodstudio too and can be adjust by many filters in realtime.

Btw, 3D sound in EE does not really provide good sound location recognition, as my experience, the 3D sound example shows that the sound source has too small volume when going behind the listener. And if sound source is in front of listener, I can hear it loud even far away.
(This post was last modified: 08-04-2023 12:31 PM by tipforeveryone.)
08-04-2023 12:28 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Esenthel/Titan with FMOD intergration
I don't have this problem.
On Windows, 3d calculations are done here:
https://github.com/Esenthel/EsenthelEngi...r.cpp#L511

I've checked and if sound is in front or behind camera (same distance), then volumes are the same.
You can check dsp.pMatrixCoefficients[0..3] all are 0.25
I have headphones (2 channels).
You might get different results if you have surround system.
Calculations are done by 'X3DAudioCalculate'
08-04-2023 03:55 PM
Find all posts by this user Quote this message in a reply
tipforeveryone Offline
Bronze Supporter

Post: #5
RE: Esenthel/Titan with FMOD intergration
https://streamable.com/ueousa Here you are. pay attention to the moment that sound source goes behind camera (listener) and front, the volume suddenly changes. too small even behind but close to listener but still loud (normal) when in front

Mine is headphone too, computer use generic Realtek audio system
(This post was last modified: 08-04-2023 04:20 PM by tipforeveryone.)
08-04-2023 04:16 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: Esenthel/Titan with FMOD intergration
That's weird because I don't have this problem, it works completely fine for me.
You can observe how the dsp.pMatrixCoefficients[0..3] values change from the source code, that will help you narrow down the problem.
08-05-2023 06:41 AM
Find all posts by this user Quote this message in a reply
tipforeveryone Offline
Bronze Supporter

Post: #7
RE: Esenthel/Titan with FMOD intergration
(08-05-2023 06:41 AM)Esenthel Wrote:  That's weird because I don't have this problem, it works completely fine for me.
You can observe how the dsp.pMatrixCoefficients[0..3] values change from the source code, that will help you narrow down the problem.

I still cant figure it out how to fix this, not only my computer, many others has the same problem. Here I have a very simple code setup for Listener

Code:
// In Update() function
sound.pos(pos);

if(Kb.b(KB_W)) pos.z += 0.05;
if(Kb.b(KB_S)) pos.z -= 0.05;
if(Kb.b(KB_A)) pos.x -= 0.05;
if(Kb.b(KB_D)) pos.x += 0.05;
  
Listener
.orn(Vec(0, 0, 1), Vec(0, 1, 0)) //Camera has the same matrix so i dont write it here
.pos(Vec(0, 0, 0));

// In Draw() function
D.text(0, 0.9, S+pos);

And here is the video https://streamable.com/eqi13d
when Z value of pos change between > and < 0, sound changes suddenly
and when sound is on the right(or left) size, move sound along Z axis will make ear on the other side hear the sound suddenly too

I think this is a serious problem
03-17-2024 07:30 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: Esenthel/Titan with FMOD intergration
You need to debug
void SoundBuffer::set3DParams(C _Sound &sound, Bool pos_range, Bool speed)
and check values of
dsp.pMatrixCoefficients

dsp.DstChannelCount should be 2 if you have 2 stereo speakers, maybe you don't have, and that's why something like that happens.
03-18-2024 07:51 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #9
RE: Esenthel/Titan with FMOD intergration
Also there are other Sound APIs available
https://github.com/Esenthel/EsenthelEngi...ders.h#L86
for Windows you have XAUDIO, DIRECT_SOUND, OPEN_AL to choose from.
03-18-2024 02:18 PM
Find all posts by this user Quote this message in a reply
Post Reply