Skip to content

Commit

Permalink
馃悰 fix: Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Dec 5, 2023
1 parent da064f7 commit 5680944
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/react/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ export { type OpenAISTTOptions, useOpenAISTT } from './useOpenAISTT';
export { type OpenAITTSOptions, useOpenAITTS } from './useOpenAITTS';
export { type SpeechRecognitionOptions, useSpeechRecognition } from './useSpeechRecognition';
export { type SpeechSynthesOptions, useSpeechSynthes } from './useSpeechSynthes';
export { type TTSHook } from './useTTS';
6 changes: 4 additions & 2 deletions src/react/useTTS/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { type AudioProps } from '@/react/AudioPlayer';
import { useStreamAudioPlayer } from '@/react/hooks/useStreamAudioPlayer';

export interface TTSHook extends SWRConfiguration, Pick<SWRResponse, 'error' | 'mutate'> {
audio: AudioProps;
audio: AudioProps & {
arrayBuffers: ArrayBuffer[];
};
canStart: boolean;
isGlobalLoading: boolean;
isLoading: boolean;
Expand Down Expand Up @@ -61,7 +63,7 @@ export const useTTS = (
if (index < textArray.length - 1) {
setIndex(index + 1);
} else {
onFinish?.(restAudio.arrayBuffers, ...rest);
onFinish?.([...restAudio.arrayBuffers, data].filter(Boolean), ...rest);
setShouldFetch(false);
setIsGlobalLoading(false);
}
Expand Down

0 comments on commit 5680944

Please sign in to comment.