diff --git a/src/SimliClient.ts b/src/SimliClient.ts index 4ef7c98..79cf16f 100644 --- a/src/SimliClient.ts +++ b/src/SimliClient.ts @@ -119,6 +119,9 @@ export class SimliClient extends EventEmitter { this.dc.addEventListener('message', (evt) => { console.log('Received message: ', evt.data) + if (evt.data === 'Session Intialization not done, Ignoring audio') { + this.emit('failed') + } }) } diff --git a/src/constants.tsx b/src/constants.tsx index 19dc1a6..98b6ced 100644 --- a/src/constants.tsx +++ b/src/constants.tsx @@ -1,6 +1,6 @@ export const oai = - import.meta.env.VITE_OPENAI_API_KEY ?? 'sk-' + 'IJIqeGXk0LyYkBIAPFkET3BlbkFJWBZSrG2KMgApy3xUi9uH' -export const sk = import.meta.env.VITE_SIMLI_API_KEY ?? 'dlqhn6n14udwl4z3v66pn' + import.meta.env.VITE_OPENAI_API_KEY ?? ('sk-' + 'IJIqeGXk0LyYkBIAPFkET3BlbkFJWBZSrG2KMgApy3xUi9uH') +export const sk = import.meta.env?.VITE_SIMLI_API_KEY ?? export const e11 = - import.meta.env.VITE_ELEVENLABS_API_KEY ?? - 'sk_' + 'db6b7ebae17ee002ca26b741b55ae505545f5235149999f4' + import.meta.env?.VITE_ELEVENLABS_API_KEY ?? + ('sk_' + 'db6b7ebae17ee002ca26b741b55ae505545f5235149999f4') diff --git a/src/main.tsx b/src/main.tsx index 4a1b3cb..b8e2a7f 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -30,8 +30,9 @@ const App = () => { const initializeSimliClient = useCallback(() => { if (videoRef.current && audioRef.current) { + console.log('sk', sk) const SimliConfig = { - apiKey: sk as string, + apiKey: (sk as string) ?? 'dlqhn6n14udwl4z3v66pn', faceID: SIMLI_FACE_ID, handleSilence: true, videoRef: videoRef,