Spaces:
Running
Running
Update flare-ui/src/app/components/environment/environment.component.ts
Browse files
flare-ui/src/app/components/environment/environment.component.ts
CHANGED
@@ -167,6 +167,108 @@ export class EnvironmentComponent implements OnInit {
|
|
167 |
}
|
168 |
}
|
169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
save() {
|
171 |
this.saving = true;
|
172 |
|
|
|
167 |
}
|
168 |
}
|
169 |
|
170 |
+
get sttLanguage(): string {
|
171 |
+
return this.environment.stt_settings?.language || 'tr-TR';
|
172 |
+
}
|
173 |
+
|
174 |
+
set sttLanguage(value: string) {
|
175 |
+
if (!this.environment.stt_settings) {
|
176 |
+
this.environment.stt_settings = this.getDefaultSTTSettings();
|
177 |
+
}
|
178 |
+
this.environment.stt_settings.language = value;
|
179 |
+
}
|
180 |
+
|
181 |
+
get sttModel(): string {
|
182 |
+
return this.environment.stt_settings?.model || 'latest_long';
|
183 |
+
}
|
184 |
+
|
185 |
+
set sttModel(value: string) {
|
186 |
+
if (!this.environment.stt_settings) {
|
187 |
+
this.environment.stt_settings = this.getDefaultSTTSettings();
|
188 |
+
}
|
189 |
+
this.environment.stt_settings.model = value;
|
190 |
+
}
|
191 |
+
|
192 |
+
get sttSpeechTimeout(): number {
|
193 |
+
return this.environment.stt_settings?.speech_timeout_ms || 2000;
|
194 |
+
}
|
195 |
+
|
196 |
+
set sttSpeechTimeout(value: number) {
|
197 |
+
if (!this.environment.stt_settings) {
|
198 |
+
this.environment.stt_settings = this.getDefaultSTTSettings();
|
199 |
+
}
|
200 |
+
this.environment.stt_settings.speech_timeout_ms = value;
|
201 |
+
}
|
202 |
+
|
203 |
+
get sttVadSensitivity(): number {
|
204 |
+
return this.environment.stt_settings?.vad_sensitivity || 0.5;
|
205 |
+
}
|
206 |
+
|
207 |
+
set sttVadSensitivity(value: number) {
|
208 |
+
if (!this.environment.stt_settings) {
|
209 |
+
this.environment.stt_settings = this.getDefaultSTTSettings();
|
210 |
+
}
|
211 |
+
this.environment.stt_settings.vad_sensitivity = value;
|
212 |
+
}
|
213 |
+
|
214 |
+
get sttNoiseReductionLevel(): number {
|
215 |
+
return this.environment.stt_settings?.noise_reduction_level || 2;
|
216 |
+
}
|
217 |
+
|
218 |
+
set sttNoiseReductionLevel(value: number) {
|
219 |
+
if (!this.environment.stt_settings) {
|
220 |
+
this.environment.stt_settings = this.getDefaultSTTSettings();
|
221 |
+
}
|
222 |
+
this.environment.stt_settings.noise_reduction_level = value;
|
223 |
+
}
|
224 |
+
|
225 |
+
get sttUseEnhanced(): boolean {
|
226 |
+
return this.environment.stt_settings?.use_enhanced ?? true;
|
227 |
+
}
|
228 |
+
|
229 |
+
set sttUseEnhanced(value: boolean) {
|
230 |
+
if (!this.environment.stt_settings) {
|
231 |
+
this.environment.stt_settings = this.getDefaultSTTSettings();
|
232 |
+
}
|
233 |
+
this.environment.stt_settings.use_enhanced = value;
|
234 |
+
}
|
235 |
+
|
236 |
+
get sttEnablePunctuation(): boolean {
|
237 |
+
return this.environment.stt_settings?.enable_punctuation ?? true;
|
238 |
+
}
|
239 |
+
|
240 |
+
set sttEnablePunctuation(value: boolean) {
|
241 |
+
if (!this.environment.stt_settings) {
|
242 |
+
this.environment.stt_settings = this.getDefaultSTTSettings();
|
243 |
+
}
|
244 |
+
this.environment.stt_settings.enable_punctuation = value;
|
245 |
+
}
|
246 |
+
|
247 |
+
get sttInterimResults(): boolean {
|
248 |
+
return this.environment.stt_settings?.interim_results ?? true;
|
249 |
+
}
|
250 |
+
|
251 |
+
set sttInterimResults(value: boolean) {
|
252 |
+
if (!this.environment.stt_settings) {
|
253 |
+
this.environment.stt_settings = this.getDefaultSTTSettings();
|
254 |
+
}
|
255 |
+
this.environment.stt_settings.interim_results = value;
|
256 |
+
}
|
257 |
+
|
258 |
+
// Helper method
|
259 |
+
private getDefaultSTTSettings(): STTSettings {
|
260 |
+
return {
|
261 |
+
speech_timeout_ms: 2000,
|
262 |
+
noise_reduction_level: 2,
|
263 |
+
vad_sensitivity: 0.5,
|
264 |
+
language: 'tr-TR',
|
265 |
+
model: 'latest_long',
|
266 |
+
use_enhanced: true,
|
267 |
+
enable_punctuation: true,
|
268 |
+
interim_results: true
|
269 |
+
};
|
270 |
+
}
|
271 |
+
|
272 |
save() {
|
273 |
this.saving = true;
|
274 |
|