The sound is alive!

Hey guys,

I don’t know if you have remarked but the sound part has been updated

in cvs with what we may call some “impovements”.

What are they?


  1. The SphericalSound was creating a new IBuffer for each file loaded—>we could have twice the same data in memory. Now there is a sound pool (which has been actually reimplemented in an other way) to share those buffers between multiple sound sources (SphericalSound(s)) .


  2. Now a spherical sound can play a sequence of different sounds. For example you can have in a game the character approaching “a” target. This target can start to emit a sequence of sounds depending of your character’s type. I explain :

    You have Doctor character of level 3 which approaches a hero : The hero because of your chars level will play :

    -HelloHealer.wav → Ithurts.wav–>CAN_YOU_HELP_ME.ogg

    OR

    You have Doctor character of level 50 which approaches a hero :

    -HelloDoc.wav → Ithurts.wav–>Please_Repair_ME.ogg



    (Ok I stop here : Too much explanations kills the explanations.)


  3. Instead of having only one sample looping the whole sequence can be looped (grammaticaly correct?); So the Sound object in the scene can be configured to emit only once. (It was looping before).



    Next work is to have volume contollers to raise or lower the environmental sounds the background music and effects; that means there will be types of sounds.



    Just a remainder : In order to have 3D effects your samples must be in mono format with a minimum of 8 bits (It’s much better to have sounds with 16 bits as I’m sure that they will not crash the machine).



    One more thing : there is a method in SphericalSound

    –>setQueueCheckPercentage which may be important. this method controls the moment when the sequence will be queued through your card).



    Well Just have a look at TestSequencedSound.java which illustrates all that I tried to explain. And don’t forget to check out the new samples that I have added. (Don’t ask me where they come from :// )



    Have fun and report me the bugs. :smiley:

Great Arman! Sounds like very good improvements. When I get back home and have a decent system to use, I can’t wait to play with all the improvements. I really like your idea about the different sounds based on events. Can we also do that with basic background music? So we could play “hero” music when approaching a friendly NPC and “combat” music when approaching a hostile?



Keep up the good work!

Hi Moyo :slight_smile:



Actually it is possible. Possible does not (yet) means it is handled automatically.

What is possible today is that : You first define the samples that will be played as sequenced. Then you can “push” some other samples in the queue; the initial one will be replayed at the next loop.

I’m thinking of the best way to handle events like you wrote.

But yes that is my idea. I want for example on a server signal to change the background music on the same source; the most difficult is to save framerate.



I mean I’m on it and it’s getting more exciting to add new features.



Hope you’ll like wet weather :slight_smile: .

Hey Arman,



Excellent work! (Although, FYI I had to move the sound files around a bit locally to get your new Test to run.)



I love that the sound effects works with the rotation of your head. And the sound track sounds great regardless of position.



Thank you for contributing to jME, this stuff is awesome and is actually useful. :slight_smile:



PS: Wow!

awsome stuff. :smiley: ,



I am actually using the new version in my game as I type, keep it up.



Is it possible to create sort of a layering type thing. Where if the player penetrates the first layer of an injured person, the injured dude would say "HEELLLPP", the next layer the injured person would play "Get a medic". Is something like this possible. I know you can have gains and so forth, but that does volume stuff, i was thinking more of play/stop?

Thanks guys,



Errr Dark I just don’t understand what you mean by “layered”, can you be more precise?

if you imagine an onion with its layers, if you penetrate the first layer, a sound plays, you penetrate the second, a different sound is played and the first sound is stopped. That sorta thing.

Well no not yet. But I’ll keep that in my mind.

Hey DP you maybe can now have an ONION_EVENT with the new implementation XD

oi, no need to diss my imaginative onion metaphor! :smiley:



I can indeed, and would you stop making stuff so dam fast, im having to build a new jar of jME everday now, get aquinted with the new stuff takes about an hour! LOL, just messing. Keep up the good work. And all you lot shall be rewarded with a free copy of my game :smiley:

Arman, my game is in 3d perspective, and I wish the sound to be played according to the player’s position rather than the camera’s position. Can this be done?



DP