LaiTool/src/main/IPCEvent/ttsIpc.ts
lq1405 efa8d3b2a2 1. 添加英文配音
2. 修复聚合推文 任务没有文件不能删掉
3. 修复聚合推文删除所有的批次任务之后,不能再添加的问题
4. 添加版本更新通知,版本更新内容提醒
5. 添加MJ代理MJ账号设置,可以删除本地的账号和同步云端的账号(主要是状态和禁用原因)
2024-10-18 12:39:40 +08:00

44 lines
1.2 KiB
TypeScript

import { ipcMain } from 'electron'
import { DEFINE_STRING } from '../../define/define_string'
import { LOGGER_DEFINE } from '../../define/logger_define'
import { TTS } from '../Service/tts'
const tts = new TTS()
export function TTSIpc() {
// 获取当前的TTS配置数据
ipcMain.handle(DEFINE_STRING.TTS.GET_TTS_CONFIG, async () => await tts.GetTTSCOnfig())
// 保存TTS配置
ipcMain.handle(
DEFINE_STRING.TTS.SAVE_TTS_CONFIG,
async (event, data) => await tts.SaveTTSConfig(data)
)
// 生成音频
ipcMain.handle(
DEFINE_STRING.TTS.GENERATE_AUDIO,
async (event, text) => await tts.GenerateAudio(text)
)
// 生成SRT字幕文件
ipcMain.handle(
DEFINE_STRING.TTS.GENERATE_SRT,
async (event, ttsId) => await tts.GenerateSRT(ttsId)
)
// 删除配音历史记录
ipcMain.handle(
DEFINE_STRING.TTS.DELETE_TTS_HISTORY,
async (event, ttsId) => await tts.DeleteTTSHistory(ttsId)
)
// 获取配音的历史记录
ipcMain.handle(
DEFINE_STRING.TTS.GET_TTS_HISTORY_DATA,
async (event, queryCondition) => await tts.GetTTSHistoryData(queryCondition)
)
ipcMain.handle(
DEFINE_STRING.TTS.GET_TTS_OPTIONS, async (event, key) => await tts.GetTTSOptions(key))
}