diff --git a/README.md b/README.md
index 54ecda1..7839796 100644
--- a/README.md
+++ b/README.md
@@ -26,24 +26,21 @@
目前支持阿里云、讯飞,其他平台陆续加入。
-**如果觉得不错,来个 star 支持下作者吧!你的 Star 是我更新代码的动力!:)**
+`如果觉得不错,来个 star 支持下作者吧!你的 Star 是我更新代码的动力!:)`
想任何想吐槽或者建议的都可以直接飞个 [issue](https://github.com/funnyzak/tts-now/issues).
-**下一步**
+## TODO
- [ ] 接入百度云
- [ ] 接入腾讯云
-- [ ] 导出标记合成配置
-
-**已完成**
-
- [x] 增加升级更新提示
- [x] 配置框增加清除配置按钮
## 目录
- [云语音合成助手](#云语音合成助手)
+ - [TODO](#todo)
- [目录](#目录)
- [发布](#发布)
- [平台](#平台)
diff --git a/package.json b/package.json
index cee59d6..cedf539 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "tts-now",
- "version": "1.0.5",
+ "version": "1.0.6",
"description": "tts assastant",
"main": "build/bundle/main.js",
"scripts": {
diff --git a/src/layout/AppMain/Single.tsx b/src/layout/AppMain/Single.tsx
index d3722e2..c653970 100644
--- a/src/layout/AppMain/Single.tsx
+++ b/src/layout/AppMain/Single.tsx
@@ -7,7 +7,9 @@ import {
LoadingOutlined,
PlayCircleOutlined
} from '@ant-design/icons'
-import { Button, Form, Input, message, Space } from 'antd'
+import {
+ Button, Form, Input, message, Space
+} from 'antd'
import ReactAudioPlayer from 'react-audio-player'
import useAppSetting from '@/hook/app'
import { TtsFileStatus } from '@/type/enums'
@@ -41,13 +43,12 @@ const singleTxtStyle = {
const Index = () => {
const { appSetting, setAppSetting } = useAppSetting()
- const getSingleTxt = () =>
- appSetting.customSetting.singleTxt &&
- appSetting.customSetting.singleTxt !== null &&
- appSetting.customSetting.singleTxt.length > 0 &&
- core.currentSpeaker(appSetting).text !== appSetting.customSetting.singleTxt
- ? appSetting.customSetting.singleTxt
- : core.currentSpeaker(appSetting).text
+ const getSingleTxt = () => (appSetting.customSetting.singleTxt
+ && appSetting.customSetting.singleTxt !== null
+ && appSetting.customSetting.singleTxt.length > 0
+ && core.currentSpeaker(appSetting).text !== appSetting.customSetting.singleTxt
+ ? appSetting.customSetting.singleTxt
+ : core.currentSpeaker(appSetting).text)
const [singleTxt] = useState(getSingleTxt())
const singleFormRef: any = useRef(null)
@@ -84,8 +85,8 @@ const Index = () => {
message.error('请设置合成内容')
}
if (
- singleTtsFile?.status &&
- singleTtsFile?.status === TtsFileStatus.PROCESS
+ singleTtsFile?.status
+ && singleTtsFile?.status === TtsFileStatus.PROCESS
) {
message.warning('正在准备播放..')
}
@@ -109,9 +110,9 @@ const Index = () => {
const exportHandle = () => {
if (
- !singleTtsFile ||
- core.isNullOrEmpty(singleTtsFile) ||
- core.isNullOrEmpty(singleTtsFile.audioUrl)
+ !singleTtsFile
+ || core.isNullOrEmpty(singleTtsFile)
+ || core.isNullOrEmpty(singleTtsFile.audioUrl)
) {
message.error('没有可导出的内容')
return
@@ -119,10 +120,11 @@ const Index = () => {
core.selectDirection('select_export_path', (outPath) => {
singleTtsFile.savePath = outPath
- singleTtsFile.saveName = `${singleTtsFile.textContent.substring(
- 0,
- 7
- )}_${new Date().getTime()}.${singleTtsFile.ttsSetting?.format || 'mp3'}`
+ singleTtsFile.saveName = `${appSetting.ttsSetting.engine.toString()}_${
+ core.currentSpeaker(appSetting).speaker
+ }_${singleTtsFile.textContent.substring(0, 7)}_${new Date().getTime()}.${
+ singleTtsFile.ttsSetting?.format || 'mp3'
+ }`
setSingleTtsFile(singleTtsFile)
core.exportAudioFile(singleTtsFile)
})
@@ -130,9 +132,9 @@ const Index = () => {
useEffect(() => {
if (
- singleFormRef &&
- singleFormRef.current !== null &&
- singleFormRef.current !== undefined
+ singleFormRef
+ && singleFormRef.current !== null
+ && singleFormRef.current !== undefined
) {
singleFormRef.current.setFieldsValue({ singleTxt: getSingleTxt() })
setSingleTtsFile({
@@ -157,18 +159,20 @@ const Index = () => {
}}
size="large"
icon={processing ? : }
- onClick={playHandle}>
+ onClick={playHandle}
+ >
立即播放
- {!singleTtsFile ||
- core.isNullOrEmpty(singleTtsFile) ||
- core.isNullOrEmpty(singleTtsFile.audioUrl) ? null : (
+ {!singleTtsFile
+ || core.isNullOrEmpty(singleTtsFile)
+ || core.isNullOrEmpty(singleTtsFile.audioUrl) ? null : (
<>
}
- onClick={exportHandle}>
+ onClick={exportHandle}
+ >
导出
{
ref={(el) => setAudioPlayer(el)}
/>
>
- )}
+ )}
diff --git a/src/utils/core.ts b/src/utils/core.ts
index e3e5dc3..edaa549 100644
--- a/src/utils/core.ts
+++ b/src/utils/core.ts
@@ -97,7 +97,7 @@ export const checkDirExist = (
): boolean => {
if (!fs.existsSync(_path || '')) {
if (_tipIfNoExists) {
- message.warning(_tipIfNoExists)
+ message.warning(_tipIfNoExists)
}
return false
}
@@ -347,7 +347,9 @@ export const ttsTasksRun = async (
_info.wordCount = _info.textContent.length
_info.ttsStart = new Date().getTime()
_info.savePath = appSetting.customSetting.savePath
- _info.saveName = `${
+ _info.saveName = `${appSetting.ttsSetting.engine.toString()}_${
+ currentSpeaker(appSetting).speaker
+ }_${
_info.fileName?.split('.')[0]
}_${new Date().getTime()}.${_info.ttsSetting.format}`
return _info