Macos support whisper cpp (#1186)

* arm64 macos support whisper.cpp

* add whisper binary for x64 macos
This commit is contained in:
an-lee
2024-11-18 12:00:18 +08:00
committed by GitHub
parent 9d254fd829
commit c23b73f034
8 changed files with 14158 additions and 2 deletions

View File

@@ -68,6 +68,12 @@ class EchogardenWrapper {
// Add temporary unhandledRejection listener
process.on("unhandledRejection", handler);
// Set the whisper executable path for macOS
if (process.platform === "darwin") {
options.whisperCpp = options.whisperCpp || {};
options.whisperCpp.executablePath = path.join(__dirname, "lib", "whisper", "main");
}
// Call the original recognize function
Echogarden.recognize(sampleFile, options)
.then((result) => {
@@ -97,6 +103,9 @@ class EchogardenWrapper {
whisper: {
model: "tiny.en",
},
whisperCpp: {
model: "tiny.en",
}
}
) {
const sampleFile = path.join(__dirname, "samples", "jfk.wav");

View File

@@ -116,7 +116,6 @@ export const EchogardenSttSettings = (props: {
<SelectContent>
<SelectItem value="whisper">Whisper</SelectItem>
<SelectItem
disabled={platformInfo?.platform === "darwin"}
value="whisper.cpp"
>
Whisper.cpp