Skip to content

Commit

Permalink
doc: 完善文档,移除测试
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhldr committed Oct 24, 2024
1 parent 9ce4354 commit af75637
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 34 deletions.
10 changes: 0 additions & 10 deletions heartale/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,3 @@ async def play(chap=1000, play_min=100):
def run_play():
"""运行主函数"""
asyncio.run(play())


async def test_play():
"""测试tts和mpv播放音频"""
txt = "恭喜!配置成功!快打开阅读app,并修改ip地址吧!"
file = "test.webm"
conf = get_config()

await get_tts(conf).download(txt, file)
await play_mp3(file, conf)
84 changes: 60 additions & 24 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,9 @@
1. [这里](https://github.com/yuhldr/heartale/releases/tag/beta)下载并安装 `heartale*.whl`

尽量用 linux,windows 系统可以用 `WSL`,什么意思,自己百度吧
linux 系统可能需要设置播放程序,看最后详细说明

2. 播放程序设置

目前测试了 `mpv``ffmpeg`,两个都行,默认 `ffmpeg`

我用的 linux,比如

ubuntu

```bash
sudo apt install ffmpeg
```

archlinux

```bash
sudo pacman -S ffmpeg
```

其他的自己想办法

3. 测试是否修改成功
2. 测试是否修改成功

终端输入

Expand All @@ -56,6 +36,15 @@

### 朗读类型

默认 `txt`,设置中

```json
"server": {
"key": "txt",
...
}
```

#### 本地 txt 文件

修改本地配置 `~/.config/bpy/config.json`,其中的
Expand Down Expand Up @@ -85,6 +74,15 @@

里面的 `192.168.1.6` 改成刚才你看到的 `ip`,端口 `1122` 一般不用改

3. 修改如下内容中的 `txt``legado`

```json
"server": {
"key": "txt",
...
}
```

### 运行

终端运行
Expand Down Expand Up @@ -118,7 +116,7 @@ heartale
},
"tts": {
"play": {
"code": ["ffplay", "-nodisp", "-autoexit", "-loglevel", "quiet"]
"code": ["paplay"]
},
"download": {
"key": "edge",
Expand All @@ -138,7 +136,45 @@ heartale
}
```

其中
### 音频播放程序

默认针对 linux,使用 `paplay`,资源消耗极小

```json
"tts": {
"play": {
"code": [
"paplay"
]
},
...
}
```

可以用 ffmpeg

```json
"tts": {
"play": {
"code": ["ffplay", "-nodisp", "-autoexit", "-loglevel", "quiet"]
},
...
}
```

也可以用 `mpv`

```json

"tts": {
"play": {
"code": ["mpv"]
},
...
}
```

#### TTS 转语音

- tts-edge

Expand Down

0 comments on commit af75637

Please sign in to comment.