unity-sentis
ONNX
UnityPaul commited on
Commit
61a1454
1 Parent(s): 7fd4d20

Upload 3 files

Browse files
Files changed (3) hide show
  1. README.md +1 -1
  2. RunJets.cs +3 -3
  3. jets-text-to-speech.sentis +2 -2
README.md CHANGED
@@ -3,7 +3,7 @@ license: cc-by-4.0
3
  library_name: unity-sentis
4
  ---
5
 
6
- # Jets Text-to-Speech Model validated for Unity Sentis (Version 1.3.0-pre.3 Only*)
7
  *Version 1.3.0 Sentis files are not compatible with version 1.4.0 and above and will need to be recreated
8
 
9
  This is a text to speech model called [Jets](https://huggingface.co/imdanboy/jets). It takes in a text string which you convert to phonemes using a dictionary and then outputs a wav to play the voice.
 
3
  library_name: unity-sentis
4
  ---
5
 
6
+ # Jets Text-to-Speech Model validated for Unity Sentis (Version 1.4.0-pre.2*)
7
  *Version 1.3.0 Sentis files are not compatible with version 1.4.0 and above and will need to be recreated
8
 
9
  This is a text to speech model called [Jets](https://huggingface.co/imdanboy/jets). It takes in a text string which you convert to phonemes using a dictionary and then outputs a wav to play the voice.
RunJets.cs CHANGED
@@ -51,7 +51,7 @@ public class RunJets : MonoBehaviour
51
 
52
  void LoadModel()
53
  {
54
- var model = ModelLoader.Load(Application.streamingAssetsPath + "/jets-text-to-speech.sentis");
55
  engine = WorkerFactory.CreateWorker(BackendType.GPUCompute, model);
56
  }
57
 
@@ -76,7 +76,7 @@ public class RunJets : MonoBehaviour
76
  void ReadDictionary()
77
  {
78
  if (!hasPhenomeDictionary) return;
79
- string[] words = File.ReadAllLines(Application.streamingAssetsPath+"/phoneme_dict.txt");
80
  for (int i = 0; i < words.Length; i++)
81
  {
82
  string s = words[i];
@@ -171,7 +171,7 @@ public class RunJets : MonoBehaviour
171
  var result = engine.Execute(input);
172
 
173
  var output = result.PeekOutput("wav") as TensorFloat;
174
- output.MakeReadable();
175
  var samples = output.ToReadOnlyArray();
176
 
177
  Debug.Log($"Audio size = {samples.Length / samplerate} seconds");
 
51
 
52
  void LoadModel()
53
  {
54
+ var model = ModelLoader.Load(Path.Join(Application.streamingAssetsPath ,"jets-text-to-speech.sentis"));
55
  engine = WorkerFactory.CreateWorker(BackendType.GPUCompute, model);
56
  }
57
 
 
76
  void ReadDictionary()
77
  {
78
  if (!hasPhenomeDictionary) return;
79
+ string[] words = File.ReadAllLines(Path.Join(Application.streamingAssetsPath,"phoneme_dict.txt"));
80
  for (int i = 0; i < words.Length; i++)
81
  {
82
  string s = words[i];
 
171
  var result = engine.Execute(input);
172
 
173
  var output = result.PeekOutput("wav") as TensorFloat;
174
+ output.CompleteOperationsAndDownload();
175
  var samples = output.ToReadOnlyArray();
176
 
177
  Debug.Log($"Audio size = {samples.Length / samplerate} seconds");
jets-text-to-speech.sentis CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f1541f940099ef2d851adfd23b43b9d0226208ba0b062da7ff7038a0315295bd
3
- size 138538708
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:405a4e8d24b07142ac6109b653750b5d97ec720bbea41c5e76838e5f30ec5c70
3
+ size 138331240