STT Hololens by jongfeelkim-VIRNECT - 1

VR & AR

Unity translation app using Google Cloud Speech-to-Text on Hololens

Unity 2019.3.5f1MIT LicenseUpdated 7 days agoCreated on March 6th, 2020
Go to source

STT-Hololens

Unity translation app using Google Cloud

  • Speech-to-Text: get result text
  • Translate text: get translated english text
  • Text-to-Speech: get english speech

on Hololens

Demo video

STT-Hololens

Developement environment

Tools

  • Unity 2019.3.5f1
  • Visual Studio Community 2019 16.4.5
    • Add workloads Game development with Unity (Unity)
    • Add workloads Desktop development with C++ (UWP)
    • Add workloads Universal Windows Platform development (UWP)

Device

  • Hololens OS build 10.0.17763.1039

Preference setup

Google Cloud Platform account

  • Sign in google cloud platform
  • Create project
    • Any name you want.
  • APIs & Services > Credentials > API Keys
    • Create API Key
  • APIs & Services > Credentials > OAuth Client ID
    • Create Client ID
  • All credentials create is done. You can see credentials page like this. GCP_Credentials.png

Locate file directory

API key

  • Create APIKey.txt file for Text to Speech and Speech to Text
  • Copy google api key string to file and paste it to in text editor

Access token

Get refresh token first

Create RefreshTokenParameters.json

  • Create RefreshTokenParameters.json file for translate
  • Copy below json text and replace your appropriate values.
{
    "client_id" : "<YourClientID>",
    "client_secret" : "<YourClientSecret>",
    "grant_type" : "refresh_token",
    "refresh_token" : "<YourRefreshToken>"
}

Build UWP project in Unity

  • Open Unity project scene from Assets/Scenes/STT_Hololens.scene
  • Open Build Settigs popup Ctrl+Shift+B or File > BuildSettings...
  • Checkout build options
    • UnityBuildSettings.png
  • Click Build button
  • Select exist folder to UWP project target.

Build Hololens app in UWP project

  • Open Visual Studio Solution file from <BuildFromUnityFolder>/STT-Hololens.sln
  • Checkout build options
    • VisualStudioBuildSettings.png
    • Solution configurations: Release or Master
    • Solution platforms: x86
    • Build to target: Device(hololens)
  • Click Deivce(Debug run) button

Reference Google Cloud APIs

Show all projects by jongfeelkim-VIRNECT