Feat: refactor STT service (#294)
* add stt hook interface * fix crypto exported to browser * refactor use-transcribe * may use openai stt * refactor: remove decprecated codes * fix undefined method
This commit is contained in:
19
enjoy/src/types/enjoy-app.d.ts
vendored
19
enjoy/src/types/enjoy-app.d.ts
vendored
@@ -213,10 +213,18 @@ type EnjoyAppType = {
|
||||
setService: (
|
||||
service: WhisperConfigType["service"]
|
||||
) => Promise<WhisperConfigType>;
|
||||
transcribeBlob: (
|
||||
blob: { type: string; arrayBuffer: ArrayBuffer },
|
||||
prompt?: string
|
||||
) => Promise<{ file: string; content: string }>;
|
||||
transcribe: (
|
||||
params: {
|
||||
file?: string;
|
||||
blob?: { type: string; arrayBuffer: ArrayBuffer };
|
||||
},
|
||||
options?: {
|
||||
force?: boolean;
|
||||
extra?: string[];
|
||||
}
|
||||
) => Promise<Partial<WhisperOutputType>>;
|
||||
onProgress: (callback: (event, progress: number) => void) => void;
|
||||
removeProgressListeners: () => Promise<void>;
|
||||
};
|
||||
ffmpeg: {
|
||||
config: () => Promise<FfmpegConfigType>;
|
||||
@@ -245,10 +253,7 @@ type EnjoyAppType = {
|
||||
};
|
||||
transcriptions: {
|
||||
findOrCreate: (params: any) => Promise<TranscriptionType>;
|
||||
process: (params: any, options: any) => Promise<void>;
|
||||
update: (id: string, params: any) => Promise<void>;
|
||||
onProgress: (callback: (event, progress: number) => void) => void;
|
||||
removeProgressListeners: () => Promise<void>;
|
||||
};
|
||||
waveforms: {
|
||||
find: (id: string) => Promise<WaveFormDataType>;
|
||||
|
||||
2
enjoy/src/types/index.d.ts
vendored
2
enjoy/src/types/index.d.ts
vendored
@@ -27,7 +27,7 @@ type NotificationType = {
|
||||
};
|
||||
|
||||
type WhisperConfigType = {
|
||||
service: "local" | "azure" | "cloudflare";
|
||||
service: "local" | "azure" | "cloudflare" | "openai";
|
||||
availableModels: {
|
||||
type: string;
|
||||
name: string;
|
||||
|
||||
Reference in New Issue
Block a user