Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

+3 votes
Hi everyone, we are using a text-to-speech program in Unity and would like to pipe it into Wwise on a bus or something.  The voice would be coming from an in-game simulated computer monitor ( a sort of AI ), and would play as 3D audio, and perhaps some effects on it.  But I am not really sure on my end how to do it.  My programmer says I need to provide a bus ID number but I cannot find any numbers with any bus.  I created a bus in Wwise, called TTS, but can't figure out what to do next.  Any thoughts?
in General Discussion by Soundy McSound (220 points)

1 Answer

+2 votes

I haven't done this before, but I think you can accomplish it using one of the two following features:

 

Wwise Audio Input is a source you can use on a Sound SFX object that takes sound generated by the game at runtime. I think it's commonly used for VOIP chat and network-streamed audio. 

Wwise External Source is instantiated in a Sound SFX object in the same way as Wwise Audio Input. This sounds like it works like Wwise Audio Input, except it points to an audio file that the programmer chooses.


I think I would start with Wwise External Source. I bet your programmer can write the TTS to a .wav file as it's rendered in real-time, convert it to a .wem, and send it to your External Source object. 

 

by Ian S. (2.1k points)
Thank you.  Our programmer wants to go with the first option, Audio Input source. (We can't be writing anything to hard drive, apparently) But he says he needs a bus number.  I don't know where I can find a bus number.  Are you familiar with this?

Edit: OK, he had to look in the actual data of the file to find it.  We found it, but I am wondering why bus numbers are not easily viewable in the Wwise authoring app... unless I am missing something, which is totally possible, and even probable!
The only way I know how is to open up the work unit and look. Work units are just XML, so you can read it in a text editor (like Sublime Text or Notepad++).

So if you're looking for a bus, navigate to your Wwise directory in Windows Explorer or Finder, and open Master-Mixer Hierarchy/Default Work Unit.wwu in a text editor. You should be able to find the name of all of your busses followed by their IDs.
OK, thank you so much for your help.  My programmer got that information by looking at the source files.. but now my programmer now says that there seemed to be some missing pieces in the unity integration for Wwise Audio Input.  For some reason, that rubs me the wrong way... I think he might be wrong there.  

So he switched to looking into Wwise External Source.  Now he specifically needs to know the structure of the .wem file format.  But he doesn't know where to find this.  We have the problem with the text to speech thingy that we don't have wavs before the game launches.  My programmer thinks that Wwise expects us to have wavs before the game launches, but we are generating the data real time.

He says that knowing the structure of the wem file format is the only solution unless they have a function in wwise to build a wem file from raw sound data that can be used at runtime and that does not write to the hard drive.

This is for Wwise external source, which he has been experimenting with.

Do you think we are better off with Wwise Audio Input?

And if my programmer is right, and all we now need is to be able to convert the raw audio data to wem format (we'd need to know the format of the data) then how can we get that?
Hi, the .wem format is proprietary to Audiokinetic, and the only way to generate them is via the Authoring Tool bank generation process or via the WwiseCLI.exe, both of which will write the .wem to disk.  You probably want to use the Audio Input if you're dealing with raw samples at runtime.
My programmer said that the audio input plugin is a no-go with Unity.  Like, it's just not supported.

Anyways, he figured out how to get it working but with the Wwise external source way.  He seems to think the other way was impossible with Unity.
Hi! I'm looking at implementing integrated voice chat in our game and ran in the same problem..
It would be awesome to get some information on how your programmer solved this issue using External Source. Any way to get in contact?
thanks!
If you're able, I'd like to discuss what your programmer did to pipe raw data into Wwise as an external source.  I have some ideas, but am feeling a bit lost at the moment.  Any help would be appreciated!
Hey!
What a great project!
I'm looking to build something similar. Will you share your programmers solution with us?
Best regards,
Anton
Hi! We're attempting to do something similiar. Unity and Wwise.  We want to pass streaming TTS audio from a URL into Wwise from Unity.  Its been a few years since this post has anyone had more success?  We have setup Wwise Audio Input but are getting stuttering playback when passing in audio to Wwise on our target (oculus quest) TIA Amos
...