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
@@ -10,6 +10,7 @@ import { MatIconModule } from '@angular/material/icon';
|
|
10 |
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
11 |
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
12 |
import { MatExpansionModule } from '@angular/material/expansion';
|
|
|
13 |
import { ApiService, Environment } from '../../services/api.service';
|
14 |
import { EnvironmentService } from '../../services/environment.service';
|
15 |
|
@@ -27,7 +28,8 @@ import { EnvironmentService } from '../../services/environment.service';
|
|
27 |
MatIconModule,
|
28 |
MatProgressSpinnerModule,
|
29 |
MatSnackBarModule,
|
30 |
-
MatExpansionModule
|
|
|
31 |
],
|
32 |
template: `
|
33 |
<div class="environment-container">
|
@@ -178,6 +180,121 @@ import { EnvironmentService } from '../../services/environment.service';
|
|
178 |
<mat-icon matPrefix>key</mat-icon>
|
179 |
<mat-hint>{{ getSTTKeyHint() }}</mat-hint>
|
180 |
</mat-form-field>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
</div>
|
182 |
|
183 |
<mat-expansion-panel class="prompt-panel">
|
@@ -336,6 +453,59 @@ import { EnvironmentService } from '../../services/environment.service';
|
|
336 |
}
|
337 |
}
|
338 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
339 |
|
340 |
::ng-deep {
|
341 |
.mat-mdc-form-field-icon-prefix {
|
|
|
10 |
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
11 |
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
12 |
import { MatExpansionModule } from '@angular/material/expansion';
|
13 |
+
import { MatSliderModule } from '@angular/material/slider';
|
14 |
import { ApiService, Environment } from '../../services/api.service';
|
15 |
import { EnvironmentService } from '../../services/environment.service';
|
16 |
|
|
|
28 |
MatIconModule,
|
29 |
MatProgressSpinnerModule,
|
30 |
MatSnackBarModule,
|
31 |
+
MatExpansionModule,
|
32 |
+
MatSliderModule
|
33 |
],
|
34 |
template: `
|
35 |
<div class="environment-container">
|
|
|
180 |
<mat-icon matPrefix>key</mat-icon>
|
181 |
<mat-hint>{{ getSTTKeyHint() }}</mat-hint>
|
182 |
</mat-form-field>
|
183 |
+
|
184 |
+
<!-- STT Settings Panel -->
|
185 |
+
<mat-expansion-panel class="stt-settings-panel" *ngIf="environment.stt_engine !== 'no_stt'">
|
186 |
+
<mat-expansion-panel-header>
|
187 |
+
<mat-panel-title>
|
188 |
+
<mat-icon>settings_voice</mat-icon>
|
189 |
+
STT Settings
|
190 |
+
</mat-panel-title>
|
191 |
+
<mat-panel-description>
|
192 |
+
Advanced speech recognition settings
|
193 |
+
</mat-panel-description>
|
194 |
+
</mat-expansion-panel-header>
|
195 |
+
|
196 |
+
<div class="stt-settings-content">
|
197 |
+
<!-- Language -->
|
198 |
+
<mat-form-field appearance="outline" class="full-width">
|
199 |
+
<mat-label>Language</mat-label>
|
200 |
+
<mat-select
|
201 |
+
name="sttLanguage"
|
202 |
+
[(ngModel)]="environment.stt_settings.language"
|
203 |
+
[disabled]="loading"
|
204 |
+
>
|
205 |
+
<mat-option value="tr-TR">Turkish (tr-TR)</mat-option>
|
206 |
+
<mat-option value="en-US">English US (en-US)</mat-option>
|
207 |
+
<mat-option value="en-GB">English UK (en-GB)</mat-option>
|
208 |
+
<mat-option value="de-DE">German (de-DE)</mat-option>
|
209 |
+
<mat-option value="fr-FR">French (fr-FR)</mat-option>
|
210 |
+
<mat-option value="es-ES">Spanish (es-ES)</mat-option>
|
211 |
+
</mat-select>
|
212 |
+
<mat-icon matPrefix>language</mat-icon>
|
213 |
+
</mat-form-field>
|
214 |
+
|
215 |
+
<!-- Model -->
|
216 |
+
<mat-form-field appearance="outline" class="full-width" *ngIf="environment.stt_engine === 'google'">
|
217 |
+
<mat-label>Recognition Model</mat-label>
|
218 |
+
<mat-select
|
219 |
+
name="sttModel"
|
220 |
+
[(ngModel)]="environment.stt_settings.model"
|
221 |
+
[disabled]="loading"
|
222 |
+
>
|
223 |
+
<mat-option value="latest_long">Latest Long (Best for long audio)</mat-option>
|
224 |
+
<mat-option value="latest_short">Latest Short (Best for short audio)</mat-option>
|
225 |
+
<mat-option value="command_and_search">Command and Search</mat-option>
|
226 |
+
<mat-option value="phone_call">Phone Call</mat-option>
|
227 |
+
<mat-option value="video">Video</mat-option>
|
228 |
+
</mat-select>
|
229 |
+
<mat-icon matPrefix>model_training</mat-icon>
|
230 |
+
</mat-form-field>
|
231 |
+
|
232 |
+
<!-- Speech Timeout -->
|
233 |
+
<div class="slider-field">
|
234 |
+
<label>Speech Timeout: {{ environment.stt_settings.speech_timeout_ms }}ms</label>
|
235 |
+
<mat-slider
|
236 |
+
[min]="500"
|
237 |
+
[max]="5000"
|
238 |
+
[step]="100"
|
239 |
+
[discrete]="true"
|
240 |
+
[displayWith]="formatMilliseconds"
|
241 |
+
>
|
242 |
+
<input matSliderThumb [(ngModel)]="environment.stt_settings.speech_timeout_ms">
|
243 |
+
</mat-slider>
|
244 |
+
<mat-hint>Silence duration to end speech detection</mat-hint>
|
245 |
+
</div>
|
246 |
+
|
247 |
+
<!-- VAD Sensitivity -->
|
248 |
+
<div class="slider-field">
|
249 |
+
<label>Voice Activity Detection Sensitivity: {{ environment.stt_settings.vad_sensitivity }}</label>
|
250 |
+
<mat-slider
|
251 |
+
[min]="0"
|
252 |
+
[max]="1"
|
253 |
+
[step]="0.1"
|
254 |
+
[discrete]="true"
|
255 |
+
>
|
256 |
+
<input matSliderThumb [(ngModel)]="environment.stt_settings.vad_sensitivity">
|
257 |
+
</mat-slider>
|
258 |
+
<mat-hint>Higher values = more sensitive</mat-hint>
|
259 |
+
</div>
|
260 |
+
|
261 |
+
<!-- Noise Reduction Level -->
|
262 |
+
<div class="slider-field">
|
263 |
+
<label>Noise Reduction Level: {{ environment.stt_settings.noise_reduction_level }}</label>
|
264 |
+
<mat-slider
|
265 |
+
[min]="0"
|
266 |
+
[max]="3"
|
267 |
+
[step]="1"
|
268 |
+
[discrete]="true"
|
269 |
+
>
|
270 |
+
<input matSliderThumb [(ngModel)]="environment.stt_settings.noise_reduction_level">
|
271 |
+
</mat-slider>
|
272 |
+
<mat-hint>0 = Off, 3 = Maximum</mat-hint>
|
273 |
+
</div>
|
274 |
+
|
275 |
+
<!-- Checkboxes -->
|
276 |
+
<div class="checkbox-group">
|
277 |
+
<mat-checkbox
|
278 |
+
[(ngModel)]="environment.stt_settings.use_enhanced"
|
279 |
+
[disabled]="loading"
|
280 |
+
*ngIf="environment.stt_engine === 'google'">
|
281 |
+
Use Enhanced Model
|
282 |
+
</mat-checkbox>
|
283 |
+
|
284 |
+
<mat-checkbox
|
285 |
+
[(ngModel)]="environment.stt_settings.enable_punctuation"
|
286 |
+
[disabled]="loading">
|
287 |
+
Enable Automatic Punctuation
|
288 |
+
</mat-checkbox>
|
289 |
+
|
290 |
+
<mat-checkbox
|
291 |
+
[(ngModel)]="environment.stt_settings.interim_results"
|
292 |
+
[disabled]="loading">
|
293 |
+
Show Interim Results
|
294 |
+
</mat-checkbox>
|
295 |
+
</div>
|
296 |
+
</div>
|
297 |
+
</mat-expansion-panel>
|
298 |
</div>
|
299 |
|
300 |
<mat-expansion-panel class="prompt-panel">
|
|
|
453 |
}
|
454 |
}
|
455 |
}
|
456 |
+
|
457 |
+
.stt-settings-panel {
|
458 |
+
margin-bottom: 20px;
|
459 |
+
margin-top: 10px;
|
460 |
+
|
461 |
+
mat-expansion-panel-header {
|
462 |
+
mat-panel-title {
|
463 |
+
display: flex;
|
464 |
+
align-items: center;
|
465 |
+
gap: 8px;
|
466 |
+
|
467 |
+
mat-icon {
|
468 |
+
color: #666;
|
469 |
+
}
|
470 |
+
}
|
471 |
+
}
|
472 |
+
}
|
473 |
+
|
474 |
+
.stt-settings-content {
|
475 |
+
padding-top: 16px;
|
476 |
+
}
|
477 |
+
|
478 |
+
.slider-field {
|
479 |
+
margin-bottom: 24px;
|
480 |
+
|
481 |
+
label {
|
482 |
+
display: block;
|
483 |
+
margin-bottom: 8px;
|
484 |
+
color: rgba(0, 0, 0, 0.87);
|
485 |
+
font-size: 14px;
|
486 |
+
}
|
487 |
+
|
488 |
+
mat-slider {
|
489 |
+
width: 100%;
|
490 |
+
}
|
491 |
+
|
492 |
+
mat-hint {
|
493 |
+
font-size: 12px;
|
494 |
+
color: rgba(0, 0, 0, 0.6);
|
495 |
+
margin-top: 4px;
|
496 |
+
}
|
497 |
+
}
|
498 |
+
|
499 |
+
.checkbox-group {
|
500 |
+
display: flex;
|
501 |
+
flex-direction: column;
|
502 |
+
gap: 12px;
|
503 |
+
margin-top: 16px;
|
504 |
+
|
505 |
+
mat-checkbox {
|
506 |
+
margin-bottom: 0;
|
507 |
+
}
|
508 |
+
}
|
509 |
|
510 |
::ng-deep {
|
511 |
.mat-mdc-form-field-icon-prefix {
|