0
0

Would I be right in assuming that you can’t use 3D positional audio with Speakermode Raw?

I’ve been fiddling around with using speakermode raw to use 12 speakers in a ring and I can access them individually with channel.setSpeakerLevels.

After setting up set3DSpeakerPosition for my 12 speakers (basically spaced out like the numbers on a clock), I tried creating a sound (using MODE.SOFTWARE and MODE._3D) and used channel.set3DAttributes to give it some location coordinates, but it’s only been playing through channel one (it’s a mono sound).

  • You must to post comments
0
0

Could it be you forgot to add the FMOD_3D settings to your createSound

  • You must to post comments
0
0

I’m pretty sure that in C# FMOD.MODE._3D is the FMOD_3D setting (which I’ve been using in createSound).

I was wondering if 3D sounds actually don’t work with Speakermode RAW (which I know used to be the case a few years back, but I was wondering if things had changed)

  • You must to post comments
0
0

Have you tried positioning the speakers using System.set3DSpeakerPosition?

  • You must to post comments
0
0

Let me give some samples of my code in case there’s something obvious that I’m missing.

Here’s part of my system’s initialisation:

[code:mwthlaji] // Now go through the speakers and assign them with directions assuming they’re in a clockwise order
for (int speaker = 0; speaker < numSpeakers – 1; speaker++) // assuming that the last speaker channel is always the sub
{
double angle = ((double)speaker / ((double)numSpeakers – 1.0)) * 2.0 * Math.PI;
double x = Math.Sin(angle);
double z = Math.Cos(angle);
system.set3DSpeakerPosition((FMOD.SPEAKER)speaker, (float)x, (float)z, true);
}
// Set sub to the location of the listener
system.set3DSpeakerPosition((FMOD.SPEAKER)(numSpeakers – 1), 0.0f, 0.0f, true);

            // Set up the listener to face 0, the door of the AVIE
            FMOD.VECTOR lPosition;
            FMOD.VECTOR lVelocity;
            FMOD.VECTOR lForward;
            FMOD.VECTOR lUp;

            lPosition.x = lPosition.y = lPosition.z = 0;
            lVelocity.x = lVelocity.y = lVelocity.z = 0;
            lForward.x = lForward.y = 0;
            lForward.z = 1;
            lUp.x = lUp.z = 0;
            lUp.y = 1;
            system.set3DListenerAttributes(0, ref lPosition, ref lVelocity, ref lForward, ref lUp);

[/code:mwthlaji]

I create my sound with:

[code:mwthlaji] result = engine.getFMODSystem().createSound(fileURL, (FMOD.MODE.SOFTWARE | FMOD.MODE.LOOP_OFF | FMOD.MODE._3D), ref sound);
engine.ERRCHECK(result);
[/code:mwthlaji]

When I play my sound, I’m setting it to start playing paused, then setting its location and after that resuming. Here’s some of the code I used for setting the location and the amount of spread among the speakers.

[code:mwthlaji] FMOD.VECTOR fmPos = new FMOD.VECTOR();
FMOD.VECTOR fmVel = new FMOD.VECTOR();

        fmPos.x = x;
        fmPos.y = y;
        fmPos.z = z;
        fmVel.x = fmVel.y = fmVel.z = 0;

        channel.set3DAttributes(ref fmPos, ref fmVel);

        // make a sound spread wider if it's closer to the listener
        if (location.z &lt; 5)
        {
            float spread = -36.0f * location.z + 180.0f;
            channel.set3DSpread(spread);
        }

[/code:mwthlaji]

At the moment, when playing my sounds, they’re coming through simply as 1-1 channels. Mono is channel 1 and Stereo is playing through channels 1 and 2. Does my code have any clues as to why that might be happening? I’m currently using numSpeakers = 13, so I have 12 directional speakers and one sub.

  • You must to post comments
0
0

Hi marcchee, I dug deeper into this and your initial assumption was correct: 3D positioning disabled for when using speakermode raw. I’m sorry for leading you in the wrong direction, speaker mode raw is not a particularly popular feature so it does not get much love. This may be possible in the upcoming FMOD5 release which has a totally revamped panning system.

  • You must to post comments
0
0

Ah no worries Peter, thanks for your help.

We use a non standard multiple speaker system, so I’ve actually ended up writing my own little bits of code that will allow me to position sounds on a larger array as well as spread the sounds over an arbitrary number of speakers.

I eagerly await developments in FMOD5 though :)

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.