Version
menu

Warning: Some protected information is not diplayed.
Please sign in if you are a licensed user for specific platforms.

Game Engine Integration

This section includes additional instructions for certain game engine integration scenarios.

Copying libraries for the Unity Integration

In addition to the speechEngine plug-in library, voices dynamic libraries are required at runtime such as vt_eng.dll or vt_fre.dll for English and French on Windows.

To copy the required libraries during the build phase, use the Unity Editor helper script located in the following directory in the Unity project: SDK/Plugins/speechEngine/Unity/Editor/SpeechEnginePluginImporterScript.cs

Converting character encoding to UTF-8

Any text you send at runtime must use UTF-8 character encoding. Depending on the platform, you might have to convert text from a different type of encoding to UTF-8. The following code samples for Unity and Unreal demonstrate how to convert UTF-16 encoding (the default on Windows) to UTF-8. You might have to modify the code for other platforms depending on the type of encoding they use.

Unity:

public byte[] ConvertUtf16ToUtf8Bytes(string utf16String)
{
	// Get the UTF-8 encoding
	Encoding utf8 = Encoding.UTF8;

	// Convert the UTF-16 string to a UTF-8 byte array
	byte[] utf8Bytes = utf8.GetBytes(utf16String);

	return utf8Bytes;
}

byte[] textArray = ConvertUtf16ToUtf8Bytes(Text);
System.Runtime.InteropServices.GCHandle pinned = System.Runtime.InteropServices.GCHandle.Alloc(textArray, System.Runtime.InteropServices.GCHandleType.Pinned);
IntPtr address = pinned.AddrOfPinnedObject();
AkUnitySoundEngine.SendPluginCustomGameData(0, this.gameObject, AkPluginType.AkPluginTypeSource, 312, 1, address, (uint)textArray.Length);
pinned.Free();
				

Unreal:

FString utf16_text = "This is a UTF-16 string at its core.";
FStringView fStringView(utf16_text);
auto ConvertedTemp = StringCast<UTF8CHAR>(fStringView.GetData(), fStringView.Len());
auto utf8_text = ConvertedTemp.Get();
SoundEngine->SendPluginCustomGameData(0, 100, AkPluginTypeSource, 312, 1, utf8_text, ConvertedTemp.Length() + 1);
				

SoundBank Generation on Mac

The speechEngine plug-in does not support the Mac platform. However, if you generate SoundBanks through the Wwise Unreal or Unity Integration, SoundBanks are automatically generated for Mac, which can cause errors. Therefore, we recommend that you explicitly exclude all speechEngine elements from your Wwise project for Mac to avoid such errors. See Excluding project elements from a platform for more information.

Compiling the speechEngine IntegrationDemo page for iOS

To compile the speechEngine plug-in page of the IntegrationDemo, you need to modify the Xcode project included with the Wwise SDK.

In the IntegrationDemo Xcode properties:

  • Under General - Frameworks, Libraries and Embedded Content:

    • Add all the vt_[lang]_q22.framework files found under Applications/Audiokinetic/Wwise[version]/SDK/iOS_Xcode[version]/[configuration]/bin.

  • Under Build Settings:

    • Add @executable_path/Frameworks to Runpath Search Paths.

    • Add ../../../iOS_Xcode$(XCODE_VERSION_MAJOR)/Profile$(EFFECTIVE_PLATFORM_NAME)/bin to Framework Search Paths.


Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise