Skip to content

Commit

Permalink
docs: add README-EN
Browse files Browse the repository at this point in the history
  • Loading branch information
fxjs committed Jul 12, 2024
1 parent 098b3c8 commit cf6c8ea
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 1 deletion.
70 changes: 70 additions & 0 deletions README-EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# tzfe-tts

#### Text-to-Speech Service (Supports CORS, Authentication)

### Environment Setup
Install [deno](https://docs.deno.com/runtime/manual/), [pnpm](https://pnpm.io/installation)

### Start
```shell
pnpm start
```

### Compile
```shell
pnpm compile:linux
#pnpm compile:macos
#pnpm compile:windows
pnpm compile:linux
# Run the binary package
./tzfe-tts
```
[Reference Compilation Documentation](https://docs.deno.com/runtime/manual/tools/compiler/)

### Environment Variables
```text
TTS_PORT The default startup port is 8901
TTS_AUTH_TOKEN Authentication token (if set to TestToken, the Authorization field must be added in the headers when calling the interface)
```

### Deployment (Examples for Arch, Debian)
##### Method 1. Register as a service
```shell
sudo sh ./install.sh

# Check service status
systemctl status tzfe-tts

# View logs
tail -F /var/log/tzfe-tts/tzfe-tts.log
```

##### Method 2. Docker Image
~_~

### Uninstall
```shell
sudo sh ./uninstall.sh
```

### Usage
```js
fetch('http://0.0.0.0:8901/v1/audio/speech', {
method: 'POST',
// headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + 'TestToken' },
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'zh-CN-shaanxi-XiaoniNeural',
input: 'Gateway error, please handle promptly.',
voice: 'rate:0|pitch:0'
})
})
.then((response) => response.blob())
.then((blob) => {
const audioUrl = URL.createObjectURL(blob);
const audio = new Audio(audioUrl);
audio.play();
});
```

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


### 环境装备
[安装 deno](https://docs.deno.com/runtime/manual/)[pnpm](https://pnpm.io/installation)
安装 [deno](https://docs.deno.com/runtime/manual/)[pnpm](https://pnpm.io/installation)

### 启动
```shell
Expand Down

0 comments on commit cf6c8ea

Please sign in to comment.