About Store Forum Documentation Contact



Post Reply 
Sound in World
Author Message
kreathyon Offline
Member

Post: #1
Sound in World
Hello,

It's possible to add sound in world by the editor plz ? for exemple sound of birds in sky or bell of church etc... smile
(This post was last modified: 06-19-2015 12:44 PM by kreathyon.)
06-19-2015 12:39 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RedcrowProd Offline
Member

Post: #2
RE: Sound in World
hey,

i don't think its possible to do this with the world editor

you will have to code it
06-19-2015 01:30 PM
Find all posts by this user Quote this message in a reply
kreathyon Offline
Member

Post: #3
RE: Sound in World
on esenthel 1.0 it possible view was that I made it but on esenthel 3.0 I noob and I do not know how to make
06-19-2015 01:34 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #4
RE: Sound in World
Hi there.

You can make a new object for this, with variables that hold a Sound file and various settings like: volume, play on launch, ..

You can then place this object in the editor and it will work in-game.

You have to call play() on the sound once to start it.

In your Update in your object, check if the sound is playing(), and then set the world position and the position of the Listener

Code:
if(m_Sound.playing() && !m_Global)
{
    m_Sound.pos(m_Pos);
    Listener.orn(Cam.matrix.z, Cam.matrix.y)  // set listener orientation (from camera)
                .pos(Cam.matrix.pos            ); // set listener position    (from camera)
}
06-19-2015 01:55 PM
Find all posts by this user Quote this message in a reply
kreathyon Offline
Member

Post: #5
RE: Sound in World
Hello,

i'm tested this tutorial http://www.esenthel.com/community/showth...ht=ObjMemx in esenthel 3.0 but no sounds in game :(
(This post was last modified: 06-23-2015 02:38 PM by kreathyon.)
06-23-2015 02:38 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #6
RE: Sound in World
Hi,

That tutorial is old, but I don't think much has changed in the engine API since then.

But definitely you should use "Element ID" parameter for the sound instead of "String path" in the object parameters.

You can always check the official tutorial for 3D sounds in the Editor's Tutorial project:
"09 - Sound/Sound 3D"
06-24-2015 11:01 PM
Find all posts by this user Quote this message in a reply
kreathyon Offline
Member

Post: #7
RE: Sound in World
(06-24-2015 11:01 PM)Esenthel Wrote:  Hi,

That tutorial is old, but I don't think much has changed in the engine API since then.

But definitely you should use "Element ID" parameter for the sound instead of "String path" in the object parameters.

You can always check the official tutorial for 3D sounds in the Editor's Tutorial project:
"09 - Sound/Sound 3D"

Hi,

I'am use Element ID in "String path" but no change and i'm use example Tutorial project: "09 - Sound/Sound 3D" and i'm this:

When I am connected to game all sounds play in a continuous loop and in the good place, then I take for a walk my character for listened everything sounds and when I cost in the entering of the city all sounds play position 0,1.130,0 and not in them positions respective.

In my code in Game.cpp (Esenthel MMO):

Code:
Sound    sound, sound1, sound2;           // Active les sons 3d
Vec      pos0( -67, 1.130, -4);           // Position du 1er  son 3d
Vec      pos1(238, 2.092, -8) ;           // Position de 2eme son 3d
Vec      pos2(155, 7.755, -25);           // Position de 3eme son 3d

In bool InitGame()

Code:
sound.play(UID(2412544291, 1229595855, 3883787402, 2048225454) , pos0, 2, true);  // Forge
   sound1.play(UID(3773098987, 1301156680, 2316581278, 663097263) , pos1, 3, true);  // Eau
   sound2.play(UID(893006642, 1083965552, 1014539650, 3081348325) , pos2, 5, true);  // Foret 1

In bool UpdateGame()

Code:
// update all 3D sound positions
   {
      sound.pos(pos0) ;
      sound1.pos(pos1);
      sound2.pos(pos2);
   }

   // update listener parameters
   {
      Listener.orn(Cam.matrix.z, Cam.matrix.y)  
              .pos(Cam.matrix.pos            );
   }

And in void DranGame()

Code:
SetMatrix();

I'm very noob in C++ and sorry if my code is verry bad :(
06-30-2015 07:21 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RedcrowProd Offline
Member

Post: #8
RE: Sound in World
//SORRY THIS IS FRENCH

tien un autre francophone =p

pm moi pour plus de détail si tu veux ( je serai off pour une semaine ;O je reviens mardi prochain )
//END OF FRENCH

is the problem that all the sounds are mixed up every where ? or only one is playing ?
(This post was last modified: 07-01-2015 02:13 AM by RedcrowProd.)
07-01-2015 02:04 AM
Find all posts by this user Quote this message in a reply
kreathyon Offline
Member

Post: #9
RE: Sound in World
Hello,

I use esenthel mmo to explain my problem:

Line red: i'm go to sound 3D and sound is ok.
Line blue : i'm return to the house and after i'm return to the sound 3D and no sound but sound is plaiyng in an other position. (in my game after return to the house all sound 3D is plaiyng in pos 0,0,0,)

In esenthel mmo i'm just inserted the code on tutorial 09 - Sound/Sound 3d

anyone for help me please ?

[Image: 843408MiniMap.jpg]
07-12-2015 01:46 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #10
RE: Sound in World
Thank you for reporting the issue!

This happened to be a bug in the engine which I've just fixed, it will work OK in next release.
07-13-2015 11:07 PM
Find all posts by this user Quote this message in a reply
Jben Offline
Member

Post: #11
RE: Sound in World
hello,
Sorry for Reply to old post

But, for last versionEE, i I hear the same problem.
Go to sound = First, not Smooth
Go back sound = it's work

you have the same problem ?

Thanks
05-04-2016 10:44 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #12
RE: Sound in World
Can you please provide a sample *.EsenthelProject with issue reproduced?

Or modify the tutorial "Apps\09 - Sound\Sound 3D"

I've tested it, but it works OK.

You can also check at these functions:
Code:
Flt SoundMinVolume    ();   void SoundMinVolume    (Flt volume); // get/set minimum volume required to play a sound            , default=0.033, if volume of a sound is less than the specified value then it will be skipped for faster processing
Int SoundMaxConcurrent();   void SoundMaxConcurrent(Int max   ); // get/set maximum number of concurrent sounds                , default=16   , if number of sounds exceeds the specified limit then sounds with lower priority will be skipped for faster processing, specifying negative value (-1) is the same as allowing unlimited number of concurrent sounds
05-05-2016 03:52 AM
Find all posts by this user Quote this message in a reply
Post Reply