one sound channel is atached with each bullet and calling beloow function to update sound position but sound begain to stop after

calling this function each time to update sound positions
[b:3q6ttka9]update function[/b:3q6ttka9]
[code:3q6ttka9]void CG::Bullet::update() {

// set position of graphical bullet according to the physical bullet
mBulletNode->setPosition( CG::Conversion::Vec3NxToOgre( mBulletActor->getGlobalPosition() ));
mBulletNode->setOrientation( CG::Conversion::QuaNxToOgre( mBulletActor->getGlobalOrientationQuat() ));

mShellNode->setPosition( CG::Conversion::Vec3NxToOgre( mShellActor->getGlobalPosition() ));
mShellNode->setOrientation( CG::Conversion::QuaNxToOgre( mShellActor->getGlobalOrientationQuat() ));

// setting sound position
bool playing;

if(playing) {

    mBulletSound->set3DAttributes( CG::Conversion::Vec3NxToFMOD( mBulletActor->getGlobalPosition()), CG::Conversion::Vec3NxToFMOD( mBulletActor->getLinearVelocity()));

if(playing) {

    mShellSound->set3DAttributes( CG::Conversion::Vec3NxToFMOD( mShellActor->getGlobalPosition()), CG::Conversion::Vec3NxToFMOD( mShellActor->getLinearVelocity()));


[b:3q6ttka9]function for creation of sound channel for bullet[/b:3q6ttka9]
[code:3q6ttka9]FMOD::Channel* CG::BulletManager::createBulletSound(eBulletType mBulletType) {

FMOD::Channel *mChannel;

    mSoundSystem->playSound(FMOD_CHANNEL_FREE, mBulletSounds[0], true, &mChannel);

case BT_GUN1:
    mSoundSystem->playSound(FMOD_CHANNEL_FREE, mBulletSounds[1], true, &mChannel);

case BT_GUN2:
    mSoundSystem->playSound(FMOD_CHANNEL_FREE, mBulletSounds[2], true, &mChannel);

    mSoundSystem->playSound(FMOD_CHANNEL_FREE, mShellSounds[2], true, &mChannel);


return ( mChannel );


after firing specific number of bullets sounds run no more, supose after 20 bullets, when i press fire button for next bullet to fire, it generates no sound. and other sound also stop listening, i have another sound attach with door before firing specific number of bullets it generates sound fine, but after firing number of bullets sound no more in the game.

Q no 2: When channel became invalid? what if we update it’s set3DAttributes when it become invalid.

In my case i am upgrading sound channel of bullet for 5 seconds ( because each bullet remain in scene for 5 second) in my game logic, when the sound attached with the channel having length only for 1 sec.

Thanks in advance.

  • You must to post comments

Are you calling FMOD::System->update() ?

you problem sounds similar to this one:

[quote:2yyqhr4x]When channel became invalid? what if we update it’s set3DAttributes when it become invalid. [/quote:2yyqhr4x]
FMOD ignores the update if the channel is invalid. It usually means there is no sound. So if there is no sound, there is no position or velocity.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.