0
0

hi.

i want play many dsp sound at the same time. but if i play nomal sound at the same time,

result = channel->getDSPHead(&dspHead);

is return FMOD_ERR_INVALID_PARAM.

my game is FPS. so my Bullet sound have two type sound.(dsp sound, and normal sound)
when played little sounds, Does not occur. (when played dsp and normal sound, this problem is occur.)

(i think that This problem deals with channel overflow..)

occasionally, application was Abnormal termination without runtime error message.

plz solve my ploblem.

  • You must to post comments
0
0

Hi Ocarinaro, welcome to the FMOD Forum.

It’s not entirely clear what you’re trying to do or what the problem is. Could you please post the code where you are calling playSound and playDSP along with any code which is returning an error.

  • You must to post comments
0
0

i post my code with playsound and setdsp.

[code:2tct25ci]
<...Init.... >

if (m_system->playSound(FMOD_CHANNEL_FREE, curSound, true, &curChannel) != FMOD_OK)
return false;
if(isDsp)
{
if( FMOD_OK != _SetDSPSound(curChannel)) //error FMOD_ERR_INVALID_PARAM
{
curChannel->stop();
return false;
//continue;
}
}

.
.
.

FMOD_RESULT CFModSnd::_SetDSPSound(FMOD::Channel* channel)
{
FMOD_RESULT result;
FMOD::DSP *dspHead;
std::vector<FMOD::DSP*> vecDsp;

.
.
.
.

// dsphead - soundTable
result = channel-&gt;getDSPHead(&amp;dspHead);
if(result != FMOD_OK)
{
    return result;
}

FMOD::DSP*  pHeadinput; 
    result = dspHead-&gt;getInput(0,&amp;pHeadinput); //error FMOD_ERR_INVALID_PARAM
if(result == FMOD_OK)
{
    for(int i=0; i&lt;size; i++)
    {
        FMOD::DSP* pDsp;
        FMOD_DSP_TYPE   createType = m_vecDsp[i].type;
        int paramCnt = m_vecDsp[i].vecParam.size();

        result = m_system-&gt;createDSPByType(createType, &amp;pDsp);
        if(result != FMOD_OK)
        {               
            return result;
        }

        for(int j=0;j&lt;paramCnt; j++)
        {
            float fdata = m_vecDsp[i].vecParam[j];
            result = pDsp-&gt;setParameter(j,fdata);
            if(result != FMOD_OK)
            {                   
                return result;
            }
        }
        vecDsp.push_back(pDsp);
    }
}
else
{       
    return result;
}

//dsphead  - x - soundTable
result = dspHead-&gt;disconnectFrom(pHeadinput);
if(result != FMOD_OK)
{
    return result;
}

//dsphead - x - dsp ? - . . . . . - dsp1 - soundtable
for(int i =0; i&lt;vecDsp.size()-1;i++)
{
    result = vecDsp[i+1]-&gt;addInput(vecDsp[i]);
    if(result != FMOD_OK)
    {           
        return result;
    }
}

//dsphead - dsp? - . . . . . . - dsp1 - soundtable
result = dspHead-&gt;addInput(vecDsp[size-1]);
if(result != FMOD_OK)
{
    return result;
}

result = vecDsp[0]-&gt;addInput(pHeadinput);
if(result != FMOD_OK)
{
    return result;
}

for(int i =0; i&lt;vecDsp.size();i++)
{
    result = vecDsp[i]-&gt;setActive(true);
    if(result != FMOD_OK)
    {           
        return result;      
    }
}

return FMOD_OK;

}
[/code:2tct25ci]

  • You must to post comments
0
0

Hi there,

Your first post said that you are getting FMOD_ERR_INVALID_PARAM from Channel::getDSPHead, then in your code it’s say that the error is coming from DSP::getInput. If DSP::getInput is returning FMOD_ERR_INVALID_PARAM, try calling DSP::getNumInputs first and making sure has inputs. From what I understand you just want to play a sound with some effects on it.

You can achieve this using System::playSound and Channel::addDSP.

I reccomend you take a look at ‘effets’ example the comes with the FMOD API.

  • You must to post comments
0
0

thank you!! have nice day!

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.