This Unity project implements a expressive AI cube that you can talk to with your voice.
It demonstrates how to integrate Hume AI's Empathic Voice Interface (EVI) into Unity applications. EVI is a conversational AI that understands and responds to emotional cues in speech.
This project uses ai.hume.unity, a Unity package, hosted on OpenUPM, that wraps the Hume .NET SDK.
- Unity 2022.3 LTS or later
- Internet connection for API calls
- Valid Hume API key
- Microphone (for voice input)
-
Clone this examples repository:
git clone https://github.com/humeai/hume-api-examples cd hume-api-examples/evi/evi-unity-quickstart -
Open the project in Unity:
- Launch Unity Hub
- Click "Open" and select the
evi-unity-quickstartfolder - The
DefaultSceneshould automatically load when you open the project
-
Set up your API key:
You must authenticate to use the Hume EVI API. Your API key can be retrieved from the Hume AI platform. For detailed instructions, see our documentation on getting your api keys.
In the Unity scene:
- Select the
SceneLauncherGameObject in the Hierarchy - In the Inspector, find the
SceneBuildercomponent - Replace
'YOUR_HUME_API_KEY_HERE'with your actual Hume API key
- Select the
-
Configure microphone permissions (platform-specific):
- macOS/Windows: Usually works out of the box
- iOS: Add
NSMicrophoneUsageDescriptionto Info.plist - Android: Add
RECORD_AUDIOpermission to AndroidManifest.xml
Assets/DefaultScene.unity- The main scene with EVI setupAssets/Scripts/HumeEVI.cs- Core EVI functionality:- WebSocket connection to EVI
- Microphone capture and audio streaming
- WAV audio parsing and playback
- Event handling for transcripts and responses
Assets/Scripts/SceneBuilder.cs- Scene management and visual feedback:SceneBuilder- Creates the interactive cube sceneConversationVisualFeedback- Handles color/animation based on stateClickToConverse- Handles click interaction
- Press Play in Unity
- Click the cube to start a conversation with EVI
- Speak into your microphone - the cube will pulse green while listening
- EVI will respond - the cube will pulse blue while speaking
- Click the cube again to end the conversation
For more advanced usage, see the Hume EVI Documentation. Also refer to the source code Hume .NET SDK repository to see method names.
