0
0

When I call FSOUND_3D_SetAttributes, it returns false, and the error reported is "An invalid parameter was passed to this function."

The sound I am playing is an ogg file.

After the call, I can hear the sound, but it seems to be frozen/stuck at 0,0,0.

I call it like this:

[code:3j0y3asm]
ret = FSOUND_3D_SetAttributes(channel, (const float*)&pos, 0);
[/code:3j0y3asm]

My pos is just a little vector class of floats, like that in the docs.

I’ve tried a few different things, like:

[code:3j0y3asm]
ret = FSOUND_3D_SetAttributes(channel, (const float*)&pos.mX, 0);
[/code:3j0y3asm]

and even:

[code:3j0y3asm]
float vec[3];
vec[0] = pos.mX;
vec[1] = pos.mY;
vec[2] = pos.mZ;

float zero[3];
zero[0] = 0.f;
zero[1] = 0.f;
zero[2] = 0.f;

ret = FSOUND_3D_SetAttributes(channel, vec, zero);
[/code:3j0y3asm]

Same results. Logged error, sound heard at 0,0,0.

Any suggestions?

  • You must to post comments
0
0

A little more info:

Immediately after the error, I call FSOUND_3D_GetAttributes, and get back the same values I sent in, no matter which code from above is used.

  • You must to post comments
0
0

Sorry to bump, but any suggestions?

  • You must to post comments
0
0

It is more likely that your channel handle is the problem parameter not the vector.

If the 3d example works, what is the difference with your program?

  • You must to post comments
0
0

<shrug>

I tried fooling around with a bunch of stuff, eventually trying this:

[code:1b2g1ncw]
float pos[3] = { -Pos.mX, Pos.mY, Pos.mZ };
[/code:1b2g1ncw]

and it worked! I was already flipping the x in my conversion, so I’m stumped as to what the problem was. Maybe some problem in casting my class to (const float*)? Maybe gremlins? Who knows.

In any case, thanks for checking in.

[EDIT]

On further poking around, it turns out the culprit was this line:

[code:1b2g1ncw]
signed char ret = FSOUND_Sample_SetMinMaxDistance(sample, 0.f, 1000000000.f);
[/code:1b2g1ncw]

I don’t specifically remember where I got those values, but it was probably 3.72 samples. In any case, this did work fine in 3.72.

When I changed it to this from the 3.75 samples:

[code:1b2g1ncw]signed char ret = FSOUND_Sample_SetMinMaxDistance(sample, 4.0f, 10000.0f);[/code:1b2g1ncw]

it starting working in 3.75.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.