Instructions to use unity/inference-engine-jets-text-to-speech with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- unity-sentis
How to use unity/inference-engine-jets-text-to-speech with unity-sentis:
string modelName = "[Your model name here].sentis"; Model model = ModelLoader.Load(Application.streamingAssetsPath + "/" + modelName); IWorker engine = WorkerFactory.CreateWorker(BackendType.GPUCompute, model); // Please see provided C# file for more details
- Notebooks
- Google Colab
- Kaggle
Bob Donovan commited on
Fix Input System compatibility and missing AudioSource
Browse filesSwitch from legacy Input to new Input System package API.
Add RequireComponent to ensure AudioSource is present.
- RunJets.cs +3 -1
RunJets.cs
CHANGED
|
@@ -2,7 +2,9 @@ using System;
|
|
| 2 |
using System.Collections.Generic;
|
| 3 |
using Unity.InferenceEngine;
|
| 4 |
using UnityEngine;
|
|
|
|
| 5 |
|
|
|
|
| 6 |
public class RunJets : MonoBehaviour
|
| 7 |
{
|
| 8 |
public ModelAsset modelAsset;
|
|
@@ -193,7 +195,7 @@ public class RunJets : MonoBehaviour
|
|
| 193 |
|
| 194 |
void Update()
|
| 195 |
{
|
| 196 |
-
if (
|
| 197 |
{
|
| 198 |
TextToSpeech();
|
| 199 |
}
|
|
|
|
| 2 |
using System.Collections.Generic;
|
| 3 |
using Unity.InferenceEngine;
|
| 4 |
using UnityEngine;
|
| 5 |
+
using UnityEngine.InputSystem;
|
| 6 |
|
| 7 |
+
[RequireComponent(typeof(AudioSource))]
|
| 8 |
public class RunJets : MonoBehaviour
|
| 9 |
{
|
| 10 |
public ModelAsset modelAsset;
|
|
|
|
| 195 |
|
| 196 |
void Update()
|
| 197 |
{
|
| 198 |
+
if (Keyboard.current.spaceKey.wasPressedThisFrame)
|
| 199 |
{
|
| 200 |
TextToSpeech();
|
| 201 |
}
|