0
0

I posted this same message in the FMODEx forum as I’m not sure where the problem is:

I’m trying to get some audio that was generated by the FMOD designer to play in code and something isn’t working right. In the designer I have set an event to be 2D, and want it to play out of the LFE. The LFE which has a value of 13.96 and the other channels are -60db. In the designer, everything works as expected and the sound is only playing in the LFE. However, when I try to play the sound in code it’s playing the sound through the Center channel and not the LFE like it is in the designer.

Here is my initialization code:
[code:1788ascc]
public bool Intialize()
{
_result = Event_Factory.EventSystem_Create(ref _eventSystem);
Error(_result);

        _result = FMOD.Factory.System_Create(ref _system);
        Error(_result);

        _result = _system.getVersion(ref _version);
        Error(_result);
        if (_version < FMOD.VERSION.number)
            Console.WriteLine("Error!  You are using an old version of FMOD " + _version.ToString("X") + ".  This program requires " + FMOD.VERSION.number.ToString("X") + ".");

        FMOD.SPEAKERMODE speakermode = FMOD.SPEAKERMODE._5POINT1;
        _result = _system.setSpeakerMode(speakermode);                         
        Error(_result);

        FMOD.CAPS caps = FMOD.CAPS.NONE;
        int minfrequency = 0, maxfrequency = 0;
        _result = _system.getDriverCaps(0, ref caps, ref minfrequency, ref maxfrequency, ref speakermode);
        Error(_result);

        if ((caps & FMOD.CAPS.HARDWARE_EMULATED) == FMOD.CAPS.HARDWARE_EMULATED)
        {
            _result = _system.setDSPBufferSize(1024, 10);                      
            Error(_result);
        }

        FMOD.GUID guid = new FMOD.GUID();
        StringBuilder driverName = new StringBuilder();
        _result = _system.getDriverInfo(0, driverName, driverName.Capacity, ref guid);
        Error(_result);

        _result = Load();
        Error(_result);

        return initialized = true;
    }


    public RESULT Load()
    {
        if (!_scenarioIsLoaded)
        {

            _result = _eventSystem.init(124, FMOD.INITFLAG.NORMAL, (IntPtr)null, FMOD.EVENT_INIT.NORMAL);
            Error(_result);

            //TODO: read this path from config file:
            _result = _eventSystem.setMediaPath(@"C:\Audio\");
            Error(_result);

            _result = _eventSystem.load("sounds.fev");
            Error(_result);

            _result = _eventSystem.getGroup("sounds/big", true, ref _truckGroup);
            Error(_result);

            _result = _eventSystem.getCategory("master", ref _master);
            Error(_result);

        }

        return _result;
    } 

[/code:1788ascc]

And the code I’m using to start/stop the event:
[code:1788ascc]
if (!_events.ContainsKey("lowsound"))
StartEvent("lowsound_grind", true);

            fmodEvent = _events["lowsound_grind"];
            fmodEvent.getParameter("frequency", ref eventParam);
            eventParam.setValue((float)_audioBuffer.TransFreqControl);

            fmodEvent.getParameter("amplitude", ref eventParam);
            eventParam.setValue((float)_audioBuffer.TransAmpControl); 

[/code:1788ascc]

Not really sure what the problem is, any suggestions would be great.

Thanks in advance.

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.