
WhisperLib
一个VoskLib的分支,使用WhisperAI代替VOSK进行语音识别
🎤 WhisperLib
一个基于事件的语音识别模组,使用 WhisperAI 将音频转录为文本。从 VoskLib 分叉而来。
✨ 功能
- 离线识别:离线使用 WhisperAI。不会向服务器发送任何音频!
- 完全客户端侧:该模组不会将 WhisperAI 运行于任何 Minecraft 服务器。
- 内置模型管理器:该模组包含一个内置的模型管理器。
- 动态加载:显示来自 HuggingFace 的可用模型。
- 可调节的麦克风设置:新增了设置界面,用于调整 VoskLib 尚未提供的麦克风相关设置。
- 安全功能:当 WhisperLib 正在监听时,会立即通知你。
📦 用户安装说明
- 从 Curseforge 下载此模组。
- 启动游戏并点击
Mods按钮。 - 找到
WhisperLib并按下Config。 - 选择你的模型并按下
Download。 - 下载完成后,点击你下载的模型。
- 按下
Save & Exit。
就是这样。
🔨 开发者安装说明
找到
build.gradle。添加以下内容:
dependencies { // ...your dependencies // Make sure it's in our Runtime (Do not shade these libraries) implementation 'io.github.givimad:whisper-jni:1.7.1' runtimeOnly 'io.github.givimad:whisper-jni:1.7.1' // Include the dev mod jar implementation fg.deobf(files("libs/whisperlib--dev.jar")) }构建项目并检查是否存在任何问题。
如果有问题,你可以通过 Curseforge 私信或 GitHub issues 联系我。
🔌 WhisperLib API
// Start Listening
VoiceManager.startListening();
// Stop Listening
VoiceManager.stopListening();
WhisperLib 和 VoskLib 在客户端侧的 Forge Event Bus 上发布它们的结果。
@Mod.EventBusSubscriber(modid = "examplemod", bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT)
public class VoiceEvents {
@SubscribeEvent
public static void onResult(WhisperVoiceResult event) {
// Get the full text.
String result = event.getText();
if (result.toLowerCase().contains("hello")) {
System.out.println("Hi!");
}
// Use the following method to exclude messages like:
// [MUSIC], [upbeat music], etc. (does not exclude *laughing*)
String filteredText = event.getSpokenText();
// do more processing...
}
}
📜 致谢
- 分叉自: VoskLib,作者 InfinityTwo。
- WhisperAI API:OpenAI (WhisperAI)
正在加载版本记录…
正在加载评论…
评论在新手盒子客户端中发表,这里同步展示。