# Streaming Vivox Voice chat into FMOD for effects

**URL:** <https://qa.fmod.com/t/streaming-vivox-voice-chat-into-fmod-for-effects/19132>\
**Category:** Unreal Engine\
**Created:** [August 15, 2022, 9:51am UTC](https://qa.fmod.com/t/streaming-vivox-voice-chat-into-fmod-for-effects/19132 "2022-08-15T09:51:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattOwenVirtex](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mattowenvirtex/32/3816_2.png) [@MattOwenVirtex](https://qa.fmod.com/u/MattOwenVirtex)\
**Post date:** [August 15, 2022, 9:51am UTC](https://qa.fmod.com/t/streaming-vivox-voice-chat-into-fmod-for-effects/19132/1 "2022-08-15T09:51:15Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [August 19, 2022, 4:54am UTC](https://qa.fmod.com/t/streaming-vivox-voice-chat-into-fmod-for-effects/19132/2 "2022-08-19T04:54:17Z")

</div>

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`](https://fmod.com/resources/documentation-api?version=2.02&page=core-api-sound.html#sound_lock), or by implementing a [`FMOD_SOUND_PCM_READ_CALLBACK`](https://www.fmod.com/resources/documentation-api?version=2.02&page=core-api-sound.html#fmod_sound_pcmread_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`](https://fmod.com/docs/2.02/api/studio-api-eventinstance.html#fmod_studio_event_callback) to assign the `FMOD::Sound` to your the Programmer Instrument on the [`FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND`](https://fmod.com/docs/2.02/api/studio-api-eventinstance.html#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](https://fmod.com/docs/2.02/api/studio-guide.html#scripting-example).

---

<div class="post-metadata">

**Author:** ![mobiuslite](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@mobiuslite](https://qa.fmod.com/u/mobiuslite)\
**Post date:** [March 17, 2024, 9:11pm UTC](https://qa.fmod.com/t/streaming-vivox-voice-chat-into-fmod-for-effects/19132/3 "2024-03-17T21:11:49Z")

</div>

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

 ![Screenshot 2024-03-17 170255](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/a/a543c668c02670d46e90038e752ffe89d6038904.png)

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!

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [March 20, 2024, 12:49am UTC](https://qa.fmod.com/t/streaming-vivox-voice-chat-into-fmod-for-effects/19132/4 "2024-03-20T00:49:31Z")

</div>

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](https://qa.fmod.com/t/trying-to-play-a-voice-data-stream-using-a-bytearray-in-unreal-engine-5/21306/5).

> [@mobiuslite](#):
>
> I’m also not quite sure how to set up the actual event in FMOD Studio.

Here is an example of a programmer instrument:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/e/e11861d40cbc2828494a3e4d38d92f5df332ae66.png)

Hope this helps!

---

<div class="post-metadata">

**Author:** ![mobiuslite](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@mobiuslite](https://qa.fmod.com/u/mobiuslite)\
**Post date:** [March 20, 2024, 1:39am UTC](https://qa.fmod.com/t/streaming-vivox-voice-chat-into-fmod-for-effects/19132/5 "2024-03-20T01:39:59Z")

</div>

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