LaiTool/src/main/IPCEvent/ttsIpc.js

17 lines
601 B
JavaScript
Raw Normal View History

2024-07-13 15:44:13 +08:00
import { ipcMain } from 'electron'
import { DEFINE_STRING } from '../../define/define_string'
import { LOGGER_DEFINE } from '../../define/logger_define'
2024-08-03 12:46:12 +08:00
import { TTS } from '../Service/tts'
const tts = new TTS()
2024-07-13 15:44:13 +08:00
export function TTSIpc() {
// 获取当前的TTS配置数据
2024-08-03 12:46:12 +08:00
ipcMain.handle(DEFINE_STRING.TTS.GET_TTS_CONFIG, async () => tts.GetTTSCOnfig())
2024-07-13 15:44:13 +08:00
// 保存TTS配置
2024-08-03 12:46:12 +08:00
ipcMain.handle(DEFINE_STRING.TTS.SAVE_TTS_CONFIG, async (event, data) => tts.SaveTTSConfig(data))
// 生成音频
ipcMain.handle(DEFINE_STRING.TTS.GENERATE_AUDIO, async (event, text) => tts.GenerateAudio(text))
2024-07-13 15:44:13 +08:00
}