Streaming Vivox Voice chat into FMOD for effects

Just as a pre-warning, I’m still learning coding at the moment so C++ is still relatively new to me, but I have a grasp of most topics.

I have currently got FMOD, Vivox and UE4 working, but I now want to stream voice data from Vivox into FMOD so we can apply effects (such as reverbs etc using snapshots).

I have a programmer event setup within the studio and have a pretty solid understanding of studio side workings. The part I need help with is transferring this stream of data into the programmer event in C++. Since this data isn’t going to live static on the client but fed from the Vivox server, how do I achieve getting this data into the programmer event?

Any help would be immensely appreciated, thanks!

I am unfamiliar with the Vivox API, but assuming you can get PCM data out of the clientside audio buffers somehow then you will be able to send it to an FMOD Studio Programmer Instrument using Sound::lock and Sound::unlock , or by implementing a FMOD_SOUND_PCM_READ_CALLBACK .
With either of these options you can populate an FMOD::Sound with PCM data from Vivox, then you can use an FMOD_STUDIO_EVENT_CALLBACK to assign the FMOD::Sound to your the Programmer Instrument on the FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND callback type.
If you haven’t come across it already, we have a C++ example on how to setup Programmer Sound callbacks: Programmer Sound Scripting Example.

Hello! I’ve been trying to implement this same thing into FMOD, and I’m wondering if I could get some help.

First off is the actual creation of the sound. This seems to be throwing a FMOD_ERR_INVALID_PARAM result. Is there something missing, or something that I’m doing wrong with how I’m passing this parameters?

When I have the creation of the EventInstance. This doesn’t seem to be calling the callbacks. The event it’s using is an empty event with a programmer instrument that lasts 20 seconds. I’m also not quite sure how to set up the actual event in FMOD Studio.

I have a callback for before the audio gets rendered for Vivox. This callback contains the PCM data that I would put into the sound object.

Is this how you would do this via the lock/unlock method?

Sorry for reviving an old post, but I felt like this was the best place to ask. Thank!

Hi,

There is currently a thread discussing something similar here: Trying to play a Voice Data stream using a ByteArray in Unreal Engine 5 - #5 by RobPotter .

Here is an example of a programmer instrument:

Hope this helps!

Awesome, thanks for linking the thread! I’ll follow the thread and see if I can make any progress on it. Thanks!

1 Like