Skip to content

Commit

Permalink
Add debug to azure cognitive services sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
jptrsn committed Feb 8, 2025
1 parent 71fdd88 commit 3b0b810
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/client/src/app/effects/auth.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { catchError, map, of, switchMap } from 'rxjs';
import { AuthActions } from '../actions/auth.actions';
import { AuthService } from '../modules/auth/services/auth.service';
import { UserActions } from '../actions/user.actions';
import { RecognitionActions } from '../actions/recogntion.actions';



Expand All @@ -14,7 +15,7 @@ export class AuthEffects {
constructor(private actions$: Actions,
private authService: AuthService) {}

login$ = createEffect(() =>
login$ = createEffect(() =>
this.actions$.pipe(
ofType(AuthActions.login),
switchMap(() => this.authService.login()
Expand All @@ -31,7 +32,7 @@ export class AuthEffects {
ofType(AuthActions.logout),
switchMap(() => this.authService.logout()
.pipe(
switchMap(() => [AuthActions.logoutSuccess(), UserActions.clearProfile()]),
switchMap(() => [AuthActions.logoutSuccess(), UserActions.clearProfile(), RecognitionActions.setEngine({ engine: 'web' })]),
catchError((err) => of(AuthActions.logoutFailure({error: err.message})))
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class AzureRecognitionService {
const apiVersion = process.env['ZIP_AUTH_API_VERSION'] || 'v1';
this.azureSttEndpoint = `${baseUrl}/${apiVersion}/azure-stt`;
this.transcriptionEnabled = toSignal(this.store.select(selectTranscriptionEnabled))
sdk.Diagnostics.SetLoggingLevel(sdk.LogLevel.Debug);
}

public initialize(language: InterfaceLanguage | RecognitionDialect): Observable<{token: string; region: string}> {
Expand Down Expand Up @@ -81,14 +82,13 @@ export class AzureRecognitionService {
this.isStreaming = false;
this.recognizer?.stopContinuousRecognitionAsync(
() => {
console.log('recognizer stopped continuous async')
// console.log('recognizer stopped continuous async')
},
(err: any) => {
this.store.dispatch(RecognitionActions.disconnectFailure({error: err.message }))
}
)
this.recognizer?.close(() => {
console.log('recognizer closed')
this.recognizer = undefined;
},
(err) => {
Expand Down

0 comments on commit 3b0b810

Please sign in to comment.