viet tts
v20241212

Viettts 는 오픈 소스 툴킷으로, 자연스러운 음성 합성 및 강력한 음성 복제품이 가능한 강력한 베트남 TTS 모델을 커뮤니티에 제공합니다. 효과적인 실험을 위해 설계된 Viettts는 베트남 음성 기술의 연구 및 응용 프로그램을 지원합니다.
Viettts는 Python 설치 프로그램 (Linux 전용, Windows 및 MacOS 지원이 곧 제공됨) 또는 Docker를 통해 설치할 수 있습니다.
git clone https://github.com/dangvansam/viet-tts.git
cd viet-tts
# (Optional) Install Python environment with conda, you could also use virtualenv
conda create --name viettts python=3.10
conda activate viettts
# Install
pip install -e . && pip cache purgeDocker, Nvidia 드라이버, NVIDIA 컨테이너 툴킷 및 CUDA를 설치하십시오.
다음 명령을 실행하십시오.
git clone https://github.com/dangvansam/viet-tts.git
cd viet-tts
# Build docker images
docker compose build
# Run with docker-compose - will create server at: http://localhost:8298
docker compose up -d
# Or run with docker run - will create server at: http://localhost:8298
docker run -itd --gpu=alls -p 8298:8298 -v ./pretrained-models:/app/pretrained-models -n viet-tts-service viet-tts:latest viettts server --host 0.0.0.0 --port 8298사용 가능한 목소리를 사용하여 음성을 종합 할 수 있습니다.
| ID | 목소리 | 성별 | 오디오를 재생합니다 |
|---|---|---|---|
| 1 | NSND-le-Chuc | ? | |
| 2 | Speechify_10 | ? | |
| 3 | Atuan | ? | |
| 4 | Speechify_11 | ? | |
| 5 | cdteam | ? | |
| 6 | Speechify_12 | ? | |
| 7 | Cross_lingual_prompt | ? | |
| 8 | Speechify_2 | ? | |
| 9 | 디프 치 | ? | |
| 10 | Speechify_3 | ? | |
| 11 | 도몬 | ? | |
| 12 | Speechify_4 | ? | |
| 13 | 잭-스파로 | ? | |
| 14 | Speechify_5 | ? | |
| 15 | nguyen-ngoc-ngan | ? | |
| 16 | Speechify_6 | ? | |
| 17 | nu-nheang | ? | |
| 18 | Speechify_7 | ? | |
| 19 | Quynh | ? | |
| 20 | Speechify_8 | ? | |
| 21 | Speechify_9 | ? | |
| 22 | Son-Tung-MTP | ? | |
| 23 | Zero_shot_prompt | ? | |
| 24 | Speechify_1 | ? |
Viettts Command Line Interface (CLI)를 사용하면 터미널에서 직접 음성을 빠르게 생성 할 수 있습니다. 사용 방법은 다음과 같습니다.
# Usage
viettts --help
# Start API Server
viettts server --host 0.0.0.0 --port 8298
# List all built-in voices
viettts show-voices
# Synthesize speech from text with built-in voices
viettts synthesis --text " Xin chào " --voice 0 --output test.wav
# Clone voice from a local audio file
viettts synthesis --text " Xin chào " --voice Download/voice.wav --output cloned.wavOpenAI 클라이언트의 환경 변수를 설정해야합니다.
# Set base_url and API key as environment variables
export OPENAI_BASE_URL=http://localhost:8298
export OPENAI_API_KEY=viet-tts # not use in current version입력 텍스트에서 음성을 만들려면 :
from pathlib import Path
from openai import OpenAI
client = OpenAI ()
output_file_path = Path ( __file__ ). parent / "speech.wav"
with client . audio . speech . with_streaming_response . create (
model = 'tts-1' ,
voice = 'cdteam' ,
input = 'Xin chào Việt Nam.' ,
speed = 1.0 ,
response_format = 'wav'
) as response :
response . stream_to_file ( 'a.wav' ) # Get all built-in voices
curl --location http://0.0.0.0:8298/v1/voices
# OpenAI format (bult-in voices)
curl http://localhost:8298/v1/audio/speech
-H " Authorization: Bearer viet-tts "
-H " Content-Type: application/json "
-d ' {
"model": "tts-1",
"input": "Xin chào Việt Nam.",
"voice": "son-tung-mtp"
} '
--output speech.wav
# API with voice from local file
curl --location http://0.0.0.0:8298/v1/tts
--form ' text="xin chào" '
--form ' audio_file=@"/home/viettts/Downloads/voice.mp4" '
--output speech.wav import fs from "fs" ;
import path from "path" ;
import OpenAI from "openai" ;
const openai = new OpenAI ( ) ;
const speechFile = path . resolve ( "./speech.wav" ) ;
async function main ( ) {
const mp3 = await openai . audio . speech . create ( {
model : "tts-1" ,
voice : "1" ,
input : "Xin chào Việt Nam." ,
} ) ;
console . log ( speechFile ) ;
const buffer = Buffer . from ( await mp3 . arrayBuffer ( ) ) ;
await fs . promises . writeFile ( speechFile , buffer ) ;
}
main ( ) ; Viettts 소스 코드는 Apache 2.0 라이센스 에 따라 릴리스됩니다. 미리 훈련 된 모델 및 오디오 샘플은 Wild Incild DataSet을 기반으로 CC By-NC 라이센스 에 따라 라이센스가 부여됩니다. 이로 인해 불편을 드려 죄송합니다.
위에서 제공된 내용은 학업 목적으로 만 사용되며 기술 능력을 보여주기위한 것입니다. 일부 예는 인터넷에서 제공됩니다. 귀하의 권리를 침해하는 콘텐츠가 있으면 제거를 요청하려면 당사에 문의하십시오.