언어모델 LLM/모델 및 프레임워크

Piper TTS: 설치 및 사용 가이드

General AI 2024. 7. 8. 23:01
728x90
반응형

Piper TTS: 간결한 설치 및 사용 가이드

1. Piper 소개

Piper는 빠르고 로컬에서 실행 가능한 신경망 기반 텍스트 음성 변환(TTS) 시스템입니다. Raspberry Pi 4에 최적화되어 있으며, 고품질 음성 합성을 제공합니다.

  • 로컬 실행, 인터넷 불필요
  • VITS로 학습된 고품질 음성
  • 다양한 언어 및 화자 스타일 지원
  • ONNX 런타임 사용으로 빠른 추론

Piper TTS: 설치 및 사용 가이드

2. 설치 및 빌드

아래와 같이 piper 저장소를 클론하고 빌드합니다.

git clone https://github.com/rhasspy/piper.git
cd piper
make

3. 음성 모델 다운로드

이 명령어는 영어(미국) 음성 모델 파일을 다운로드합니다. 이 ONNX 파일은 Piper가 텍스트를 음성으로 변환할 때 사용하는 핵심 모델입니다.

wget https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/lessac/medium/en_US-lessac-medium.onnx
wget https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/lessac/medium/en_US-lessac-medium.onnx.json

4. Piper 사용하기

Piper로 텍스트를 음성으로 변환하기: build 디렉토리로 이동 후, 터미널에 echo "원하는 텍스트" | ./piper --model en_US-lessac-medium.onnx --output_file 출력파일명.wav 명령어를 입력하면, 입력한 텍스트가 음성으로 변환되어 WAV 파일로 저장됩니다.

echo "I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhäuser Gate. All those moments will be lost in time, like tears in rain. Time to die." | ./piper --model en_US-lessac-medium.onnx --output_file blade_runner_speech.wav

 

bladerunner.wav
0.59MB

5. 문제 해결

Piper 사용 중 espeak-ng-data 관련 오류가 발생하면, 다음과 같은 임시 해결책을 시도해 볼 수 있습니다.

sudo cp -Rf ~/piper/build/pi/share/espeak-ng-data/ /usr/share/

주의: 이 방법은 시스템 파일을 직접 수정하므로 주의가 필요합니다.

6. 참고 링크

이 저장소에서 최신 업데이트, 문서, 이슈 트래커를 확인할 수 있습니다.

728x90
반응형