
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
A fast, local neural text to speech system that sounds great and is optimized for the Raspberry Pi 4.
A fast, local neural text to speech system that sounds great and is optimized for the Raspberry Pi 4. Piper is used in a variety of projects.
OPENJTALK_DICTIONARY_DIR
: OpenJTalk辞書へのパス(未設定時は自動ダウンロード)OPENJTALK_VOICE
: HTSボイスモデル(.htsvoice)へのパス(未設定時は自動ダウンロード)PIPER_AUTO_DOWNLOAD_DICT
: 0
に設定すると自動ダウンロードを無効化PIPER_OFFLINE_MODE
: 1
に設定するとオフラインモード(ネットワーク接続不要)pin_memory=True
を設定し GPU 転送を最適化preprocess.py
に --timeout-seconds
を追加し、ハングする発話を自動タイムアウト/スキップpiper_train
に --num-workers
を追加し、DataLoader のワーカー数をコマンドラインから指定可能にpiper_train
に --save-top-k
を追加し、チェックポイント保存個数をコマンドラインから指定可能にpiper-tts-plus
として公開し、pip install
で簡単インストール可能に--auto_lr_scaling
)python -m piper_train \
--dataset-dir /path/to/dataset \
--batch-size 16 \
--devices 2 \
--strategy ddp \
--base_lr 2e-4
# 注: --auto_lr_scaling はデフォルトで有効
# 無効にする場合は --disable_auto_lr_scaling を使用
--resume_from_checkpoint
でチェックポイントからの学習再開--resume_from_single_speaker_checkpoint
でシングルスピーカーモデルからマルチスピーカーへの変換--use-cuda
オプションでONNX Runtime CUDAプロバイダーを有効化--gradient_clip_val
- 勾配クリッピング--accumulate_grad_batches
- 勾配累積によるバッチサイズ仮想拡張--precision
- Mixed Precision Training対応(16-mixed等)--detect_anomaly
- 学習時の異常検出機能scripts/evaluation/
)
echo 'Welcome to the world of speech synthesis!' | \
./piper --model en_US-lessac-medium.onnx --output_file welcome.wav
Listen to voice samples and check out a video tutorial by Thorsten Müller
Voices are trained with VITS and exported to the onnxruntime.
プラットフォーム | アーキテクチャ | OpenJTalk対応 | 備考 |
---|---|---|---|
Linux | x86_64 (amd64) | ✅ | フルサポート |
Linux | ARM64 | ✅ | フルサポート (CMakeビルド使用) |
macOS | ARM64 (Apple Silicon)のみ | ✅ | M1/M2/M3以降のMac専用 |
Windows | x64 | ✅ | フルサポート |
2024年より、macOSではApple Silicon (M1/M2/M3以降) のみをサポートしています。
Intel Mac (x86_64) のサポートは終了しました。以下の代替方法をご利用ください:
Dockerを使用(推奨)
# Dockerイメージをプル
docker pull ghcr.io/ayutaz/piper-plus:latest
# 実行例
docker run --rm -v $(pwd):/data ghcr.io/ayutaz/piper-plus:latest \
echo "Hello from Docker" | piper --model /data/model.onnx --output_file /data/output.wav
ソースからビルド
# 依存関係をインストール
brew install cmake onnxruntime
# ビルド
git clone https://github.com/ayutaz/piper-plus.git
cd piper-plus
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(sysctl -n hw.ncpu)
仮想マシンでLinux版を使用
通常通りダウンロードしてご利用いただけます。初回実行時のセキュリティ警告については、以下をご参照ください。
ダウンロードしたバイナリを初めて実行する際、macOSのセキュリティ機能により警告が表示される場合があります。以下のコマンドで検疫属性を削除してください:
# ダウンロードしたファイルを展開後
xattr -cr piper/
# または特定のバイナリのみ
xattr -cr piper/bin/piper
xattr -cr piper/bin/open_jtalk # 日本語TTSを使用する場合
これにより、Gatekeeperの警告なしに実行できるようになります。
Our goal is to support Home Assistant and the Year of Voice.
Download voices for the supported languages:
You will need two files per voice:
.onnx
model file, such as en_US-lessac-medium.onnx
.onnx.json
config file, such as en_US-lessac-medium.onnx.json
The MODEL_CARD
file for each voice contains important licensing information. Piper is intended for text to speech research, and does not impose any additional restrictions on voice models. Some voices may have restrictive licenses, however, so please review them carefully!
You can run Piper with Python or download a binary release:
If you want to build from source, see the Makefile and C++ source.
Clone the repository:
git clone https://github.com/rhasspy/piper.git
cd piper
Create build directory:
mkdir build
cd build
Configure and build:
cmake ..
cmake --build . --config Release
Linux: You must download and extract piper-phonemize to lib/Linux-$(uname -m)/piper_phonemize
before building.
For example, lib/Linux-x86_64/piper_phonemize/lib/libpiper_phonemize.so
should exist for AMD/Intel machines.
Windows: See the Windows Setup Guide for detailed instructions.
macOS: The build process will automatically download required dependencies.
.onnx
and .onnx.json
filespiper
binary with text on standard input, --model /path/to/your-voice.onnx
, and --output_file output.wav
For example:
echo 'Welcome to the world of speech synthesis!' | \
./piper --model en_US-lessac-medium.onnx --output_file welcome.wav
For multi-speaker models, use --speaker <number>
to change speakers (default: 0).
--use-cuda
- Enable GPU acceleration with CUDA--quiet
/ -q
- Disable logging output--phoneme-silence <phoneme> <seconds>
- Set silence duration for specific phonemes--length-scale <value>
- Adjust speech speed (default: 1.0, smaller = faster)--noise-scale <value>
- Control audio variation (default: 0.667)--noise-w <value>
- Control phoneme duration variation (default: 0.8)--sentence-silence <seconds>
- Silence between sentences (default: 0.2)See piper --help
for more options.
Piper can stream raw audio to stdout as its produced:
echo 'This sentence is spoken first. This sentence is synthesized while the first sentence is spoken.' | \
./piper --model en_US-lessac-medium.onnx --output-raw | \
aplay -r 22050 -f S16_LE -t raw -
This is raw audio and not a WAV file, so make sure your audio player is set to play 16-bit mono PCM samples at the correct sample rate for the voice.
The piper
executable can accept JSON input when using the --json-input
flag. Each line of input must be a JSON object with text
field. For example:
{ "text": "First sentence to speak." }
{ "text": "Second sentence to speak." }
Optional fields include:
speaker
- string
speaker_id_map
in config (multi-speaker voices only)speaker_id
- number
output_file
- string
The following example writes two sentences with different speakers to different files:
{ "text": "First speaker.", "speaker_id": 0, "output_file": "/tmp/speaker_0.wav" }
{ "text": "Second speaker.", "speaker_id": 1, "output_file": "/tmp/speaker_1.wav" }
Piper has been used in the following projects/papers:
See the training guide and the source code.
Pretrained checkpoints are available on Hugging Face
See src/python_run
Install with pip
:
# 基本機能のみ
pip install piper-tts-plus
# GPU 版 (CUDA 環境がある場合)
pip install "piper-tts-plus[gpu]"
# HTTP サーバー機能を含む場合
pip install "piper-tts-plus[http]"
# GPU + HTTP
pip install "piper-tts-plus[gpu,http]"
This will automatically download voice files the first time they're used. Use --data-dir
and --download-dir
to adjust where voices are found/downloaded.
If you'd like to use a GPU, install the onnxruntime-gpu
package:
.venv/bin/pip3 install onnxruntime-gpu
and then run piper
with the --cuda
argument. You will need to have a functioning CUDA environment, such as what's available in NVIDIA's PyTorch containers.
FAQs
A fast, local neural text to speech system that sounds great and is optimized for the Raspberry Pi 4.
We found that piper-tts-plus demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.