バージョン
menu

ゲームエンジンインテグレーション

このセクションには、特定のゲームエンジンインテグレーションのシナリオにおける追加の手順が記載されています。

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.

必要なライブラリをビルド時にコピーするには、Unityプロジェクト内の以下のディレクトリにあるUnity Editorヘルパースクリプトをご使用ください: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 + 1);
pinned.Free();
				

Unreal:

FString utf16_text = 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);
				

MacのSoundBank生成

speechEngineプラグインはMacプラットフォームに対応していません。しかしWwise UnrealまたはUnity IntegrationでSoundBankを生成すると、SoundBankがMac向けに自動的に生成されるため、エラーが発生する場合があります。そこで、そのようなエラーを回避するため、Macに関してすべてのspeechEngine要素をWwiseプロジェクトから明示的に除外することが推奨されます。詳細についてはExcluding project elements from a platformをご覧ください。

iOS向けにspeechEngineのIntegrationDemoページをコンパイルする

IntegrationDemoのspeechEngineプラグインページをコンパイルするには、Wwise SDKに含まれるXcodeプロジェクトを変更する必要があります。

IntegrationDemoのXcodeプロパティで以下を行います。

  • General - Frameworks, Libraries and Embedded Content下に:

    • Applications/Audiokinetic/Wwise[version]/SDK/iOS_Xcode[version]/[configuration]/binにあるすべてのvt_[lang]_q22.frameworkファイルを追加します。

  • Build Settings下で:

    • Runpath Search Paths@executable_path/Frameworksを追加します。

    • Framework Search Paths../../../iOS_Xcode$(XCODE_VERSION_MAJOR)/Profile$(EFFECTIVE_PLATFORM_NAME)/binを追加します。


このページはお役に立ちましたか?

サポートは必要ですか?

ご質問や問題、ご不明点はございますか?お気軽にお問い合わせください。

サポートページをご確認ください

あなたのプロジェクトについて教えてください。ご不明な点はありませんか。

プロジェクトを登録していただくことで、ご利用開始のサポートをいたします。

Wwiseからはじめよう