Oviya commited on
Commit
6fb02c5
·
1 Parent(s): fde50ac

update audiourl

Browse files
src/app/pronunciation/pronunciation.component.ts CHANGED
@@ -314,7 +314,7 @@ export class PronunciationComponent implements OnDestroy, OnInit {
314
  form.append('word', this.word);
315
 
316
  try {
317
- const res = await this.http.post<any>(`${this.backendURL}/pron/check_pronunciation`, form).toPromise();
318
 
319
  // Compute phonemic score (backend provides phoneme_similarity in range 0..1)
320
  const phonemeSimilarity = Number(res?.phoneme_similarity ?? res?.phonemeSimilarity ?? 0);
@@ -327,7 +327,7 @@ export class PronunciationComponent implements OnDestroy, OnInit {
327
  this.result = {
328
  score: phonemePct,
329
  suggestion: (typeof res?.suggestion === 'string') ? res.suggestion : '',
330
- feedbackAudioUrl: res?.audio_url ? `${this.backendURL}/pron/${res.audio_url}` : undefined,
331
  phonemeScore: phonemePct,
332
  acousticScore: isNaN(acousticScore) ? undefined : acousticScore
333
  };
 
314
  form.append('word', this.word);
315
 
316
  try {
317
+ const res = await this.http.post<any>(`${this.backendURL}/check_pronunciation`, form).toPromise();
318
 
319
  // Compute phonemic score (backend provides phoneme_similarity in range 0..1)
320
  const phonemeSimilarity = Number(res?.phoneme_similarity ?? res?.phonemeSimilarity ?? 0);
 
327
  this.result = {
328
  score: phonemePct,
329
  suggestion: (typeof res?.suggestion === 'string') ? res.suggestion : '',
330
+ feedbackAudioUrl: res?.audio_url ? `${this.backendURL}/${res.audio_url}` : undefined,
331
  phonemeScore: phonemePct,
332
  acousticScore: isNaN(acousticScore) ? undefined : acousticScore
333
  };
src/app/pronunciation/pronunciation.service.ts CHANGED
@@ -14,8 +14,7 @@ export class ApiService {
14
  : 'http://localhost:5000'; // <-- ensure this matches your Flask app port
15
 
16
  // Pronunciation blueprint base path (matches backend blueprint url_prefix '/pron')
17
- // NOTE: backend blueprint defines routes like "/generate_teacher_audio" under the `pron` blueprint.
18
- private pronBase = `${this.ragHost}/pron`;
19
 
20
  constructor(private http: HttpClient) { }
21
 
 
14
  : 'http://localhost:5000'; // <-- ensure this matches your Flask app port
15
 
16
  // Pronunciation blueprint base path (matches backend blueprint url_prefix '/pron')
17
+ private pronBase = `${this.ragHost}`;
 
18
 
19
  constructor(private http: HttpClient) { }
20