0
0

OK….

I have just implemented a graphic equalizer in my application, and it all seems to be working fine… however…

now, there is a delay of perhaps 2 seconds between releasing the slider for the master volume and the volume actually changing. It does change, and to the right level, but it never had the delay before I added the EQ stuff…
I am using FSOUND_SetSFXMasterVolume to get the volume based on the slider position.

Has anyone else had this problem? – does anyone have a suggestion on how to fix it?

Thanks.

  • You must to post comments
0
0

Sorted… I had a buffer size set to 1000…. changing it to 100 sorted the problem and allows the EQ and Spectrum analyser to still work fine.

  • You must to post comments
0
0

OK.. it works kinda…

If I pause the channel with FSOUND_SetPaused it jumps and stutters until it finally hangs my machine.
The same thing happens if I play a second mp3 track.

When I am pausing or starting a new stream to be played, do I need to pause the EQ effects in some way?

If so, any chance of an example? – or perhaps point me to one?

I should add that this is my initialization code::
[code:1pwe6zqb]
err = FmodManaged.FSOUND.Function.Initialization.FSOUND_SetBufferSize( 500 );
err = FmodManaged.FSOUND.Function.Initialization.FSOUND_Init(44100, 32, FmodManaged.FSOUND.Enums.FSOUND_INIT_FLAGS.FSOUND_INIT_ENABLESYSTEMCHANNELFX);
if( err == false )
{
MessageBox.Show( "Failed to initialize Fmod sound system" );
}
else
{
err = FmodManaged.FSOUND.Function.Update.FSOUND_SetSFXMasterVolume( this.volumeSlider.Value );

            FmodManaged.FSOUND.Function.Channels.FSOUND_SetPaused( (int)FmodManaged.FSOUND.Enums.FSOUND_MISC_VALUES.FSOUND_SYSTEMCHANNEL, true );
            for( idx = 0; idx < 10; idx ++ )
            {
                eqList[idx] = FmodManaged.FSOUND.Function.FX.FSOUND_FX_Enable( (int)FmodManaged.FSOUND.Enums.FSOUND_MISC_VALUES.FSOUND_SYSTEMCHANNEL, FmodManaged.FSOUND.Enums.FSOUND_FX_MODES.FSOUND_FX_PARAMEQ );
            }
            FmodManaged.FSOUND.Function.Channels.FSOUND_SetPaused( (int)FmodManaged.FSOUND.Enums.FSOUND_MISC_VALUES.FSOUND_SYSTEMCHANNEL, false );

            for( idx = 0; idx < 10; idx ++ )
            {
                SetEQLevel( idx, 0 );
            }

[/code:1pwe6zqb]

where SetEQLevel is
[code:1pwe6zqb]
private void SetEQLevel( int eqID, int val )
{
int centre = 0;;

        switch( eqID )
        {
            case 0:
                centre = 80;
                break;
            case 1:
                centre = 170;
                break;
            case 2:
                centre = 310;
                break;
            case 3:
                centre = 600;
                break;
            case 4:
                centre = 1000;
                break;
            case 5:
                centre = 3000;
                break;
            case 6:
                centre = 6000;
                break;
            case 7:
                centre = 12000;
                break;
            case 8:
                centre = 14000;
                break;
            case 9:
                centre = 16000;
                break;
        }

        FmodManaged.FSOUND.Function.Channels.FSOUND_SetPaused( (int)FmodManaged.FSOUND.Enums.FSOUND_MISC_VALUES.FSOUND_SYSTEMCHANNEL, true );
        FmodManaged.FSOUND.Function.FX.FSOUND_FX_SetParamEQ( eqList[eqID], centre, 18, val );
        FmodManaged.FSOUND.Function.Channels.FSOUND_SetPaused( (int)FmodManaged.FSOUND.Enums.FSOUND_MISC_VALUES.FSOUND_SYSTEMCHANNEL, false );
    }

[/code:1pwe6zqb]

and then for each time I play an mp3 track I call the following:

[code:1pwe6zqb]
stream = FmodManaged.FSOUND.Function.Stream.FSOUND_Stream_Open(playPath, FmodManaged.FSOUND.Enums.FSOUND_MODES.FSOUND_STEREO|FmodManaged.FSOUND.Enums.FSOUND_MODES.FSOUND_NORMAL, 0 , 0);
playLength = (uint)FmodManaged.FSOUND.Function.Stream.FSOUND_Stream_GetLength( stream );
mediaChannel = FmodManaged.FSOUND.Function.Stream.FSOUND_Stream_PlayEx(-1, stream, dspUnit, true);
FmodManaged.FSOUND.Function.Channels.FSOUND_SetPaused( mediaChannel, false);
[/code:1pwe6zqb]

Everything worked fine until I added the EQ effects, and whilst I am using c# and a .net wrapper I’m sure that isn’t it, but probably more something I am failing to do…

I know that I am using a channel of -1 in the PlayEx function, but this wrapper does not have an enum for the next free channel and I worked out that -1 is the same thing.

When I am pausing the channel I am just using this code:

[code:1pwe6zqb]
public void PauseMediaPlaying( bool state )
{
FmodManaged.FSOUND.Function.Channels.FSOUND_SetPaused( mediaChannel, state );
}
[/code:1pwe6zqb]

  • You must to post comments
0
0

A little ** bump **

  • You must to post comments
0
0

Thats the odd thing – it only seems to do it on MY dev machine… as is often the way.

It is easier to reproduce than switching streams, if I set the volume to be zero I get the same problem. This would suggest it is something that is out of my control???

You mention a directx bug – do you know if it was ever resolved, and if so, which version. I am running 9.0b

Cheers.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.