ciyidogan commited on
Commit
99cbdb5
·
verified ·
1 Parent(s): 8355f10

Update flare-ui/src/app/components/environment/environment.component.ts

Browse files
flare-ui/src/app/components/environment/environment.component.ts CHANGED
@@ -52,6 +52,10 @@ export class EnvironmentComponent implements OnInit {
52
  stt_engine_api_key: ''
53
  };
54
 
 
 
 
 
55
  // Separate STT settings object with defaults
56
  sttSettings: STTSettings = {
57
  speech_timeout_ms: 2000,
@@ -133,8 +137,18 @@ export class EnvironmentComponent implements OnInit {
133
  onTTSEngineChange() {
134
  if (this.environment.tts_engine === 'no_tts') {
135
  this.environment.tts_engine_api_key = '';
 
 
 
 
136
  }
137
  }
 
 
 
 
 
 
138
 
139
  onSTTEngineChange() {
140
  if (this.environment.stt_engine === 'no_stt') {
@@ -197,7 +211,8 @@ export class EnvironmentComponent implements OnInit {
197
  // Include STT settings in the save
198
  const saveData = {
199
  ...this.environment,
200
- stt_settings: this.sttSettings
 
201
  };
202
 
203
  this.apiService.updateEnvironment(saveData).subscribe({
 
52
  stt_engine_api_key: ''
53
  };
54
 
55
+ ttsSettings: any = {
56
+ use_ssml: false
57
+ };
58
+
59
  // Separate STT settings object with defaults
60
  sttSettings: STTSettings = {
61
  speech_timeout_ms: 2000,
 
137
  onTTSEngineChange() {
138
  if (this.environment.tts_engine === 'no_tts') {
139
  this.environment.tts_engine_api_key = '';
140
+ this.ttsSettings.use_ssml = false;
141
+ } else if (!this.isTTSProviderSSMLCapable()) {
142
+ // SSML desteklemiyorsa kapat
143
+ this.ttsSettings.use_ssml = false;
144
  }
145
  }
146
+
147
+ isTTSProviderSSMLCapable(): boolean {
148
+ // SSML destekleyen provider'lar
149
+ const ssmlProviders = ['google', 'azure', 'amazon'];
150
+ return ssmlProviders.includes(this.environment.tts_engine);
151
+ }
152
 
153
  onSTTEngineChange() {
154
  if (this.environment.stt_engine === 'no_stt') {
 
211
  // Include STT settings in the save
212
  const saveData = {
213
  ...this.environment,
214
+ stt_settings: this.sttSettings,
215
+ tts_settings: this.ttsSettings
216
  };
217
 
218
  this.apiService.updateEnvironment(saveData).subscribe({