esp-ai
Version:
Provide a complete set of AI dialogue solutions for your development board, including but not limited to the IAT+LLM+TTS integration solution for the ESP32 series development board. | 为你的开发板提供全套的AI对话方案,包括但不限于 `ESP32` 系列开发板的 `IAT+LLM+TTS` 集成方案。
17 lines (16 loc) • 562 B
JavaScript
const path = require('path');
const fs = require('fs');
const log = require('../utils/log');
const play_temp = require('./play_temp');
const fn = (ws) => {
const { iatDu } = G_config;
const filePath = iatDu === true ? path.join(__dirname, `./du.mp3`) : iatDu;
if (!fs.existsSync(filePath)) {
log.error(`提示音地址未找到音频文件,请正确配置 iatDu !!!`)
}
return async () => {
// await play_temp("du.pcm", ws, 0.8, 24);
await play_temp(filePath, ws);
}
}
module.exports = fn;