This commit is contained in:
Hk-Gosuto
2024-03-26 17:02:41 +08:00
parent 70690f64c5
commit bd1a8dcc3a
4 changed files with 28 additions and 19 deletions

View File

@@ -1,5 +1,6 @@
import { ChatGPTApi } from "../client/platforms/openai";
import { getSTTLang } from "../locales";
import { isFirefox } from "../utils";
export type TranscriptionCallback = (transcription: string) => void;
@@ -94,6 +95,7 @@ export class WebTranscriptionApi extends SpeechApi {
constructor(transcriptionCallback?: TranscriptionCallback) {
super();
if (isFirefox()) return;
const SpeechRecognition =
(window as any).SpeechRecognition ||
(window as any).webkitSpeechRecognition;