Voice chat problem

Hi,

I working on a project where we have a voice chat, and all the voices are handled by FMOD.
I have a question about the creation and playing of the sound from the CORE level.
How do We can load all the sounds created on a BUS?
This will solve our problem of return on the speaking…

    FMODLib.MODE soundMode = FMODLib.MODE.OPENUSER | 
    FMODLib.MODE.LOOP_NORMAL;            
    res = FMODUnity.RuntimeManager.CoreSystem.createSound("Photon AudioOut", soundMode, ref exinfo, out sound);
    if (res != FMODLib.RESULT.OK)
    {
        Error = "failed to createSound: " + res;
        logger.LogError(logPrefix + Error);
        return;
    }
    
    voiceReciveBus = FMODUnity.RuntimeManager.GetBus("bus:/Voices/VoiceReceive");
    voiceReciveBus.getChannelGroup(out voiceReciveChannel);

    res = coreSystem.playSound(sound, voiceReciveChannel, false, out channel);      
    channel.getChannelGroup(out FMODLib.ChannelGroup cg);
    if (res != FMODLib.RESULT.OK)
    {
        Error = "failed to playSound: " + res;
        logger.LogError(logPrefix + Error);
        return;
    }

This code works fine but on the mixer we get nothing…

I hope to find a solution.
Kind regard,

Nicholas

2 Likes

we’re working and got stuck on a similar case any hint about it would be appreciated.

1 Like

Same problem here!

Ideally you don’t want to be digging into the Core API of Studio objects, but you should be able to use an event containing a programmer instrument. This will handle the issue of attaching your Core level sound to the Studio System.

FMOD - Scripting Examples | Programmer Sounds

Alright so I was trying to do the same thing ( I am using Photon Voice + FMOD)

This is the correct way to do this

            FMODLib.GUID busGUID = FMODLib.GUID.Parse("GUID HERE (GET IT FROM FMOD STUDIO MIXER");
            FMODLib.Studio.Bus targetBus;
            FMODUnity.RuntimeManager.StudioSystem.getBusByID(busGUID, out targetBus);
            var lockResult = targetBus.lockChannelGroup();
            FMODUnity.RuntimeManager.StudioSystem.flushCommands();
            targetBus.getChannelGroup(out var busChannelGroup);
            FMODLib.RESULT res = coreSystem.playSound(sound, busChannelGroup, false, out channel);

I am not sure why it works this way and not the one you wrote but it does

Best,
Alex