Skip to content

Latest commit

 

History

History
76 lines (55 loc) · 3.11 KB

File metadata and controls

76 lines (55 loc) · 3.11 KB

Empathic Voice Interface (EVI) | Unity Quickstart

Jumpstart your development with Hume's EVI API in Unity!

Overview

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.

Prerequisites

  • Unity 2022.3 LTS or later
  • Internet connection for API calls
  • Valid Hume API key
  • Microphone (for voice input)

Setup Instructions

  1. Clone this examples repository:

    git clone https://github.com/humeai/hume-api-examples
    cd hume-api-examples/evi/evi-unity-quickstart
  2. Open the project in Unity:

    • Launch Unity Hub
    • Click "Open" and select the evi-unity-quickstart folder
    • The DefaultScene should automatically load when you open the project
  3. 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 SceneLauncher GameObject in the Hierarchy
    • In the Inspector, find the SceneBuilder component
    • Replace 'YOUR_HUME_API_KEY_HERE' with your actual Hume API key
  4. Configure microphone permissions (platform-specific):

    • macOS/Windows: Usually works out of the box
    • iOS: Add NSMicrophoneUsageDescription to Info.plist
    • Android: Add RECORD_AUDIO permission to AndroidManifest.xml

Project Structure

  • Assets/DefaultScene.unity - The main scene with EVI setup
  • Assets/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 scene
    • ConversationVisualFeedback - Handles color/animation based on state
    • ClickToConverse - Handles click interaction

Usage

  1. Press Play in Unity
  2. Click the cube to start a conversation with EVI
  3. Speak into your microphone - the cube will pulse green while listening
  4. EVI will respond - the cube will pulse blue while speaking
  5. Click the cube again to end the conversation

Troubleshooting

For more advanced usage, see the Hume EVI Documentation. Also refer to the source code Hume .NET SDK repository to see method names.