Skip to content

Commit 530dc05

Browse files
Fix problem with tts uri
Previous commit wasn't a good fix
1 parent 34f51a0 commit 530dc05

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

unity/Editor/BaseAgentController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ private async void OnRecordStop(AudioChunk recordedAudio)
208208
private IEnumerator PostText(string text)
209209
{
210210
var bodyRaw = System.Text.Encoding.UTF8.GetBytes(text);
211-
using (var request = new UnityWebRequest($"{_ttsURI}/tts", "POST"))
211+
using (var request = new UnityWebRequest(_ttsURI, "POST"))
212212
{
213213
request.uploadHandler = new UploadHandlerRaw(bodyRaw);
214-
request.downloadHandler = new DownloadHandlerAudioClip($"{_ttsURI}/tts", AudioType.WAV);
214+
request.downloadHandler = new DownloadHandlerAudioClip(_ttsURI, AudioType.WAV);
215215
request.SetRequestHeader("Content-Type", "text/plain");
216216

217217
request.timeout = _requestTimeout;
@@ -229,4 +229,4 @@ private IEnumerator PostText(string text)
229229
#endregion
230230
}
231231
}
232-
#endif
232+
#endif

unity/Editor/CreateSettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private void OnGUI()
126126

127127
_customOllamaURI = EditorGUILayout.TextField(new GUIContent("Custom Ollama URI", "If empty, Ollama URI will be default \"localhost:11434\""), _customOllamaURI);
128128

129-
_customTTSURI = EditorGUILayout.TextField(new GUIContent("Custom TTS URI", "If empty, TTS URI will be default \"localhost:7777\""), _customTTSURI);
129+
_customTTSURI = EditorGUILayout.TextField(new GUIContent("Custom TTS URI", "If empty, TTS URI will be default \"http://localhost:7777/tts\""), _customTTSURI);
130130
//
131131

132132
if (GUILayout.Button("Save"))
@@ -245,7 +245,7 @@ private void OnGUI()
245245
File.WriteAllText(_absolutePathToMainPy, mainPyContent);
246246

247247
// Save the settings into a JSON file(unreadable code moment)
248-
var data = new JsonData(LogUtils.logLevel, string.IsNullOrEmpty(_customOllamaURI) ? "http://localhost:11434" : _customOllamaURI, string.IsNullOrEmpty(_customTTSURI) ? "http://localhost:7777" : _customTTSURI, _requestTimeout);
248+
var data = new JsonData(LogUtils.logLevel, string.IsNullOrEmpty(_customOllamaURI) ? "http://localhost:11434" : _customOllamaURI, string.IsNullOrEmpty(_customTTSURI) ? "http://localhost:7777/tts" : _customTTSURI, _requestTimeout);
249249

250250
var json = JsonUtility.ToJson(data, true);
251251

0 commit comments

Comments
 (0)