Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release Image

on:
push:
tags:
- v*

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Setup Docker
uses: seepine/action-setup-docker@v1
id: meta
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker build push
uses: docker/build-push-action@v6
with:
file: ./Dockerfile
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.actor }}/easy-voice:${{ steps.meta.outputs.version }}
ghcr.io/${{ github.actor }}/easy-voice:latest
21 changes: 16 additions & 5 deletions packages/backend/src/lib/node-edge-tts/edge-tts-fixed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,22 @@ class EdgeTTS {
throw new Error('audioPath is required when outputType is "file"')
}

let _wsConnect: WebSocket
try {
_wsConnect = await this._connectWebSocket()
} catch (err) {
throw new Error(`Failed to connect WebSocket: ${(err as Error).message}`)
let _wsConnect: WebSocket | undefined
const retryCount = 3
let lastError;
for (let attempt = 1; attempt <= retryCount; attempt++) {
try {
_wsConnect = await this._connectWebSocket();
break;
} catch (err) {
lastError = err;
if ( attempt !== retryCount ){
await new Promise(resolve => setTimeout(resolve, attempt * 100));
}
}
}
if ( _wsConnect === undefined ){
throw new Error(`Failed to connect WebSocket: ${(lastError as Error).message}`)
}

let audioStream: WriteStream | undefined
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/utils/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function createOpenAIClient() {
let currentConfig: OpenAIConfig = {
baseURL: OPENAI_BASE_URL,
model: MODEL_NAME,
timeout: 60000,
timeout: parseInt(process.env['OPENAI_TIMEOUT'] || '60000'),
apiKey: OPENAI_API_KEY,
}
logger.debug(`init openai with: `, {
Expand Down