0
0

OK im using a 3D sound, what im trying to do is update its position every logic frame based on the object that it is attached to, but it makes some really weird funky echo on the sound

Here’s the code
[code:187b1zdm]
void Sound::Update()
{
if(!attached || m_type != THREE_D)
{
return;
}

    Ogre::Vector3 pos;
    pos = m_node->getPosition();

    m_pos[0] = pos.x;
    m_pos[1] = pos.y;
    m_pos[2] = pos.z;

    UpdateSoundAttributes();
}

void Sound::UpdateSoundAttributes()
{
int channel = FSOUND_PlaySoundEx(FSOUND_FREE, m_sample, 0, false);
FSOUND_3D_SetAttributes(channel, m_pos, m_vel);
}
[/code:187b1zdm]

Any help would be appreciated

  • You must to post comments
0
0

Yes that would work, but the objects position has changed every frame, and the sound would no longer be in sync with the object

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.