SoundSystem and fadeIn

Hi,

After wrote this simple API http://www.java-gaming.org/index.php/topic,23004.0.html
I’m starting to replace it by SoundSystem in my game and see how it works, especially with the openAL plugin.

One of the functionnality that i need to refactor is “starting a sound with a fadeIn”.

I’m trying this kind of code but it doesn’t work (the sound starts without fades):

 
            SoundSystem ss = new SoundSystem(); // plugins and codec was previously configured
            ss.newStreamingSource(false,"espace_01","espace_01.ogg",true, 0, 0, 0, SoundSystemConfig.ATTENUATION_NONE, 0 );
            ss.fadeOutIn(null , "espace_01" , 0L , 2000L );
            ss.play("espace_01");

I’m sure i miss something important, but i’m not be able to find it…

In the counterpart, the fadeOut works fine with:


           ss.fadeOut("espace_01" , null , 1500 );

Sébastien.

I think the reason might be that the sound has to be playing for fadeOutIn to function. I’m not sure if or why I made it behave this way - I’ll look at the code to see if it can be changed. Obviously, being able to fade in is an important capability. In the meantime, try and see if you can fix the problem by creating the streaming source from a small silent sound effect, play it, and then call fadeOutIn

Tanks for your reply.

I’m trying also this code

            ss.newStreamingSource(false,"espace_01","espace_01.ogg",true, 0, 0, 0, SoundSystemConfig.ATTENUATION_NONE, 0 );
            ss.setVolume( "espace_01" , 0f );
            ss.play("espace_01");
            ss.fadeOutIn( null , "espace_01" , 0L , 5000L );
            ss.setVolume( "espace_01" , 1f ); // without : the sequence is completely silent
                                              // with : the sound play at the normal volume without any fadeIn

But now way to start the fadeIn.

That definitely looks like a bug. I’ll let you know what I find out.

Thanks, i will keep an eye here :wink:

Hello, have you any news of this issue ?

Best regards,
Sébastien.

Sorry for the delay. My hard drive recently crashed and I’ve had to go through the tedious process of restoring backups. I’m back up and running now, though, so I’ll work on this later today.

Ok, solved the problem. For fade-in effect use something like this:

            SoundSystem ss = new SoundSystem(); // plugins and codec was previously configured
            ss.newStreamingSource( false, "espace_01", "espace_01.ogg", true, 0, 0, 0, SoundSystemConfig.ATTENUATION_NONE, 0 );
            ss.fadeOutIn( "espace_01", "espace_01.ogg", 0L, 2000L );
            ss.play( "espace_01" );

Bug-Fixes Update

Sound System jPCT
Sound System

JavaSound library pluggin

WAV codec pluggin

[i]What’s New:

  • Updated CodecWav link to current version
  • Improved LibraryJavaSound performance slightly in non-Sun Java versions
  • Handled rare pan-control exception
  • Fixed fadeOutIn bug which caused fade-in effect to be silent[/i]

I donwload it, i try it and let you a feedback.
Tanks you.

Sébastien.

It works, thanks !!