0
0

I’m getting an FMOD_ERR_INVALID_PARAM on particular sounds and in particular circumstances. These are 48KHz 16-bit [b:wls1zy2u]stereo[/b:wls1zy2u] wav files. I’m loading them as 3D software samples, and asynchronously.

The following program illustrates the problem:
[code:wls1zy2u]

include <iostream>

include "fmod.hpp"

using namespace std;
using namespace FMOD;

static bool bBlah = true;

//————————————————————————————————-
//————————————————————————————————-
static FMOD_RESULT F_CALLBACK c_sSoundNonblockLoad(
FMOD_SOUND * sound,
FMOD_RESULT result)
{
FMOD::Sound * pSound = (FMOD::Sound*)sound;

bBlah = false;

if (result != FMOD_OK)
{
    cout &lt;&lt; &quot;Unable to load sound - &quot; &lt;&lt; FMOD_ErrorString(result) &lt;&lt; endl;
    return FMOD_OK;
}
cout &lt;&lt; &quot;Sound loaded successfully - &quot; &lt;&lt; FMOD_ErrorString(result) &lt;&lt; endl;

return FMOD_OK;

}

//————————————————————————————————-

int main(int argc, char * argv[])
{
System * pSystem = NULL;
Sound * pSound = NULL;
Channel * pChannel = NULL;

System_Create(&amp;pSystem);
pSystem-&gt;init(128, FMOD_INIT_NORMAL, NULL);

char szFile[MAX_PATH];
strcpy(szFile, &quot;hg_burnin_01.wav&quot;);

// Mode flags
int nMode = FMOD_DEFAULT | FMOD_LOOP_OFF | FMOD_3D | FMOD_SOFTWARE | FMOD_CREATESAMPLE;

FMOD_CREATESOUNDEXINFO tExInfo;
FMOD_CREATESOUNDEXINFO * pExInfo = &amp;tExInfo;
memset(&amp;tExInfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));
tExInfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
tExInfo.nonblockcallback = c_sSoundNonblockLoad;
nMode |= FMOD_NONBLOCKING;

FMOD_RESULT res = pSystem-&gt;createSound(szFile, FMOD_MODE(nMode), pExInfo, &amp;pSound);
if(res != FMOD_OK)
{
    cout &lt;&lt; &quot;Error creating sound&quot; &lt;&lt; endl;
}
else
{
    cout &lt;&lt; &quot;Sound created successfully&quot; &lt;&lt; endl;
}

while(bBlah)
{
    pSystem-&gt;update();
}

pSound-&gt;release();
pSystem-&gt;release();

int x;
cin &gt;&gt; x;

return 0;

}
[/code:wls1zy2u]

If I load the sound without the FMOD_NONBLOCKING flag, then it loads properly. Also, this only happens with stereo sounds. Mono sounds load properly.

Thanks!

  • Guy
  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.