0
0

hi there….

my program is used fmod..

when 3d sound play, ( ex, in first person shooting game, click fire key,

play bullet effect sound ( when bullet collide wall )

the beginning, 3-4 times, don’t play 3d sound….

after 4 times, play 3d sound…

i dont know this matter..

i coding 3d attribute, 3d listener attribute

my code ( summation )

FSOUND_SetBufferSize( 100 );
FSOUND_Stream_SetBufferSize( 400 );
FSOUND_Init( 22050, 512, FSOUND_INIT_ENABLEOUTPUTFX )

SoundData->m_ptSample = FSOUND_Sample_Load( FSOUND_FREE, pstrFileName, FSOUNDMODE, 0, 0 );

( FSOUNDMODE is FSOUND_NORMAL | FSOUND_FORCEMONO | FSOUND_HW3D )

loop start ——-

else if ( pBullet->dwType <= BT_SHOT )
{
switch ( pBullet->dwCollType )
{
case M_STONE :
m_oEffectSnd.m_ppoHitBullet[ M_STONE ] [
Rand4m_iRnd4 ] ].Set3DAttribute( pBullet->vPos );
m_oEffectSnd.m_ppoHitBullet[ M_STONE ][
Rand4[ m_iRnd4 ] ].InstantPlay( );
break;
}
}

FSOUND_3D_Listener_SetAttributes( m_vCurPosition, m_vVelocity, m_vView.x, m_vView.y, m_vView.z, m_vUp.x, m_vUp.y, m_vUp.z );
FSOUND_Update();

loop end ——

ask me plz

  • You must to post comments
0
0

are you using FSOUND_FREE with FSOUND_PlaySound? ————–

i using FSOUND_PlaySoundEx;

( code )

inline void InstantPlay( )
{
    if( m_ptSample )
    {
        //FSOUND_PlaySoundEx( m_iPoolindex, m_ptSample, NULL, TRUE); 
        //FSOUND_SetVolume( m_iPoolindex, Volume );
        m_iChannel = FSOUND_PlaySoundEx( FSOUND_FREE, m_ptSample, NULL, TRUE); 
        FSOUND_SetVolume( m_iChannel, m_iVolume );
    }
}

Also why do you have 512 channels specified in fsound_init? ————–

many channel ?

i have to soud source ( 193 wav file )

this wave files is using both all ( 2d, 3d sound )

so, 193 * 2 = 386. because of 512 channels is sufficient, i used…

reason to FSOUND_INIT_ENABLEFX specified is that i see in manual ( FSOUND_INIT_FLAGS )

and, my develop envrionment is directX 8.1b

Question….

FSOUND_PlaySoundEx( FSOUND_FREE, m_ptSample, NULL, TRUE)

when i using FSOUND_FREE, play 3d sound…

when i using poolindex instead of FSOUND_FREE, dont play 3d sound

poolindex is FSOUND_Sample_Load()’s return value

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.