0
0

Hello everyone,

I got a basic question about surround in FMOD. I hope I don’t double post but I couldn’t find anything fitting to this.

The question is, is there anything like a real low level example for making surround in FMOD with a single looping event?

Or better, how do I make an Event of the Designer a surround sound?

I tried to set it to a world relative 3D Sound but how does FMOD get the coordinates of the sound and the listener?
I just found the 3D-Panner and the parameters but I thought I could use the x,y,z coordinates of my editor and give it via a dll or udp connection to an event in fmod?

But I think I understand something basically wrong about how to do the surround stuff in FMOD…is that right?
Hope you can help me!?

Thank you ! :)

  • You must to post comments
0
0

In the API directory there is a file called fmodex.chm, that is a complete reference of all the API functions.

  • You must to post comments
0
0

do you have any more ideas what I could have done wrong? or maybe a hint why the events aren’t working in 5.1?

  • You must to post comments
0
0

oh my god….it was in front of me all the time. I don’t know why I couldn’t find it…

then…tank you and sorry…lol…shame on me…that was really stupid
😳

  • You must to post comments
0
0

[quote="brett":ht31y47s]If the multichannel example works it must be soemthing to do with your code setup that we’re not seeing.
Try fmod’s 3d example, and just change the axis that the sound ping pongs on from left to right to front to back (ie x becomes Z).[/quote:ht31y47s]

also works…

if i use the 3ddemo of the fmoddesignerapi the 3d works but it’s also stereo. so is it maybe something about working with events and the designer?

EDIT:

If I use the Audition3D tool of the Designer I only get a surround outout if I chose Asio 5.1 Output in the preferences. If I use DirectSound it’s just a Stereo output. But, the 3D example and the multichannel example work with the same DirectSound configuration in 5.1
This happens on two computers with different sound cards. One from creative, one from terratec…

  • You must to post comments
0
0

Hello, it’s me again :)

I got a question about surround output again.

Meanwhile, i got a little program running where i can move the listener in a 3D world with fix object that have attached 3D-Sounds.
Everything works fine, the stereo panning etc.

But now, I want the output on a 5.1 System but I really don’t get how to to that.

I created 3D Sounds in the Designer and use getEvent to load them into my program. And now I have to tell the program to use 5.1 output I think.

I already tried setSpeakerMode(FMOD_SPEAKERMODE_5POINT1) but that’s not working.

Before I initialized the event system i called:
[code:3nt16wy5] FMOD::System_Create(&fmodSystem);
fmodSystem->setSpeakerMode(FMOD_SPEAKERMODE_5POINT1);
fmodSystem->init(6, FMOD_INIT_NORMAL, 0);[/code:3nt16wy5]

Then I found out, that createSound works with 5.1 output but then I have to load the sounds directly and not the events, but I want to use the designer, so that’s not working for me?!

Do I have to use the 3D-Pan Effect in the Designer and control it by a parameter? Then I would have to do it for every layer in every event?!

I really don’t get what I have to do to get an 5.1 output? Anyone maybe has a hint for me?

Thank you very much!

  • You must to post comments
0
0

If the multichannel example works it must be soemthing to do with your code setup that we’re not seeing.
Try fmod’s 3d example, and just change the axis that the sound ping pongs on from left to right to front to back (ie x becomes Z).

  • You must to post comments
0
0

Hey, I checked the multichannel example. Everything works very well, output on every channel.

I didn’t use the orientation because i wanted to get the basics running first. I thought if my listener moves around a sound object, the surround panning should already work. I tried to use the orientation now but I still just got a stereo output.

Is there maybe something wrong with my events? Or is Surround only running with the FMOD::System via createSound like in the multichannel example and not with the FMOD Event System?

  • You must to post comments
0
0

Firstly, check the multispeakeroutput example to make sure your soundcard/speakers are working properly.

Next you don’t seem to be setting the orientation of your listener, that seems odd to me.

  • You must to post comments
0
0

Hey,

I tried this startup sequence but 5.1 is still not working. If I’m using the Surround Panner in FMOD Designer, I have an output for every loudspeaker so my sound card is working. (I tried several, Terratec, Creative, Realtek…) But in my application is still just stereo.

Is there anywhere a little example showing how to make an application with an event in 5.1? Maybe I just have something wrong in my code.
I split the init- and the start-part into two functions and call them in the main() function of my program.

Here is my init function:
[code:2fbntkpa] FMOD_RESULT result;

ERRCHECK(result = FMOD::System_Create(&fmodSystem));
ERRCHECK(result = fmodSystem->getVersion(&version));

if (version < FMOD_VERSION){
    printf("Error!  You are using an old version of FMOD %08x.  This program requires %08x\n", version, FMOD_VERSION);
    //return 0;
}

ERRCHECK(result = fmodSystem->getNumDrivers(&numdrivers));

ERRCHECK(result = fmodSystem->setHardwareChannels(0,0,0,0));  /* Skip EAX probe which can crash/corrupt some bad drivers. */

if (numdrivers == 0){
    ERRCHECK(result = fmodSystem->setOutput(FMOD_OUTPUTTYPE_NOSOUND));
}
else
{
    ERRCHECK(result = fmodSystem->getDriverCaps(0, &caps, 0, 0, &speakermode));

    ERRCHECK(result = fmodSystem->setSpeakerMode(speakermode));       /* Set the user selected speaker mode. */

    if (caps & FMOD_CAPS_HARDWARE_EMULATED)             /* The user has the 'Acceleration' slider set to off!  This is really bad for latency!. */
    {                                                   /* You might want to warn the user about this. */
        ERRCHECK(result = fmodSystem->setDSPBufferSize(1024, 10));
    }

    ERRCHECK(result = fmodSystem->getDriverInfo(0, name, 256, 0));

    if (strstr(name, "SigmaTel"))   /* Sigmatel sound devices crackle for some reason if the format is PCM 16bit.  PCM floating point output seems to solve it. */
    {
        ERRCHECK(result = fmodSystem->setSoftwareFormat(48000, FMOD_SOUND_FORMAT_PCMFLOAT, 0,0, FMOD_DSP_RESAMPLER_LINEAR));
    }
}

result = fmodSystem->init(100, FMOD_INIT_NORMAL, 0);
if (result == FMOD_ERR_OUTPUT_CREATEBUFFER)         /* Ok, the speaker mode selected isn't supported by this soundcard.  Switch it back to stereo... */
    {
    ERRCHECK(result = fmodSystem->setSpeakerMode(FMOD_SPEAKERMODE_STEREO));

    result = fmodSystem->init(100, FMOD_INIT_NORMAL, 0);/* ... and re-init.*/

    if (result == FMOD_ERR_OUTPUT_CREATEBUFFER)         /* Now the directsound driver can't even create a stereo buffer - great, let's try WINMM ... */
    {
        ERRCHECK(result = fmodSystem->setOutput(FMOD_OUTPUTTYPE_WINMM));

        ERRCHECK(result = fmodSystem->init(100, FMOD_INIT_NORMAL, 0));/* ... and re-init. */
    }
//Init Event System
ERRCHECK(result = FMOD::EventSystem_Create(&eventsystem));
ERRCHECK(result = eventsystem->init(64, FMOD_INIT_NORMAL, 0, FMOD_EVENT_INIT_NORMAL));
ERRCHECK(result = eventsystem->setMediaPath("..\\vr\\data\\"));
ERRCHECK(result = eventsystem->load("virtual_planetarium.fev", 0, 0));
//laden der einzelnen Events
ERRCHECK(result = eventsystem->getEvent("vr/test/event1", FMOD_EVENT_DEFAULT, &event1));
ERRCHECK(result = eventsystem->getEvent("vr/test/event2", FMOD_EVENT_DEFAULT, &event2)); 

[/code:2fbntkpa]

And then the…my loop function
First I’m reading a lot of pos variables via udp and then:
[code:2fbntkpa]
FMOD_RESULT result;

FMOD_VECTOR listenerpos = {lstnr_x, lstnr_y, lstnr_z};
result = eventsystem->set3DListenerAttributes(0, &listenerpos, 0, 0, 0);

    FMOD_VECTOR event1_position = {bl_x, bl_y, bl_z};
    FMOD_VECTOR event1_velocity = {0, 0, 0};
    ERRCHECK(event1->set3DAttributes(&event1_position, &event1_velocity));
    ERRCHECK(result = event1->start());

    FMOD_VECTOR event2_position = {grn_x, grn_y, grn_z};
    FMOD_VECTOR event2_velocity = {0, 0, 0};
    ERRCHECK(event2->set3DAttributes(&event2_position, &event2_velocity));
    ERRCHECK(result = event2->start());

    ERRCHECK(result = eventsystem->update());
    //Sleep(15);  /*I don't use this, because I'm using a usp connection, the sleep function makes the connection unsync.*/

    FMOD_EVENT_STATE state;

    ERRCHECK(result = event1->getState(&state));
    printf("Event is %s       \r", (state & FMOD_EVENT_STATE_PLAYING) ? "playing" : "stopped");

    ERRCHECK(result = event2->getState(&state));
    printf("Event is %s       \r", (state & FMOD_EVENT_STATE_PLAYING) ? "playing" : "stopped");
} 

while (key != 27);

ERRCHECK(result = eventsystem->release());

return 0;

[/code:2fbntkpa]

That’s it. And no 5.1 Output for me. Maybe you have any ideas or can tell me what I’m doing completely wrong :)

Thank you very much!

  • You must to post comments
0
0

any suggestions for me? :)

  • You must to post comments
0
0

You should check this page viewtopic.php?f=10&t=9305

Then it is simply a matter of your windows speaker mode setting being set to the correct setup (ie 5.1).

  • You must to post comments
0
0

When you say ‘surround sound’ i think you mean spatialized 3D sound. ‘surround sound’ more commonly refers to multichannel output such as 5.1 and 7.1.

[quote:1xip2y26]I tried to set it to a world relative 3D Sound but how does FMOD get the coordinates of the sound and the listener? [/quote:1xip2y26]
That is correct, now to audition your 3D sound go to ‘Window->Audition 3D’. That window will allow you to set the position of the event relative to the listener.

To position your 3D event in the game your programmer has to use Event::set3DAttributes.

  • You must to post comments
0
0

[quote="peter":3a9zrqkd]When you say ‘surround sound’ i think you mean spatialized 3D sound. ‘surround sound’ more commonly refers to multichannel output such as 5.1 and 7.1.

[quote:3a9zrqkd]I tried to set it to a world relative 3D Sound but how does FMOD get the coordinates of the sound and the listener? [/quote:3a9zrqkd]
That is correct, now to audition your 3D sound go to ‘Window->Audition 3D’. That window will allow you to set the position of the event relative to the listener.

To position your 3D event in the game your programmer has to use Event::set3DAttributes.[/quote:3a9zrqkd]

Hi,
thank you for your answer :)

Yeah, that’S what I mean.

Hm, I gotta check out that Event::set3DAttributes thing. Can I "move" the sound with this function in the Game? I mean, if an object moves to the right, can I give over the coordinates to the event and move the sound?!

and

Is there something documentation or reference of all the FMOD functions? For example a little doc that tells me what the "Event::set3DAttributes" do in the designer or something like that. Couldn’t find something.

And thank you very much for your help…best support forum I’ve seen so far :)

  • You must to post comments
Showing 13 results
Your Answer

Please first to submit.