mcpField
Q
qwen3-tts-mlx

qwen3-tts-mlx

github.com/agiseekクリエイティブ・メディア464 回インストール35 週間前に更新
リポジトリ

qwen3-tts-mlx について

qwen3-tts-mlxは、MLXでQwen3-TTSを実行するApple Silicon Mac向けのローカル音声合成スキルです。多言語生成、スタイル制御、テキストによる声の設計、参照音声からの声のクローンに対応します。

主な機能

  1. 0111言語の音声合成
  2. 029種類の内蔵ボイス
  3. 03指示文によるスタイル制御
  4. 04説明文からのボイス設計
  5. 05参照音声からのクローン
  6. 06一括吹き替え処理

活用シーン

  1. 01ナレーションやオーディオブックのオフライン制作
  2. 02動画向けの多言語吹き替え
  3. 03説明文に基づくカスタムボイス作成
  4. 04短い音声サンプルからの声のクローン

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/agiseek/agent-skills --skill qwen3-tts-mlx

インストール後、Claude Code で/qwen3-tts-mlxを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

references/
dubbing_format.md
scripts/
batch_dubbing.py
run_tts.py

詳細

Qwen3-TTS MLX

MLX を使用して、Apple Silicon(M1/M2/M3/M4)上で Qwen3-TTS をローカル実行します。11 言語、9 種類の内蔵ボイス、ボイスクローン、テキストの説明からのボイスデザインに対応しています。

使用する場面

  • Mac 上で完全にオフラインで音声を生成する
  • ナレーション、オーディオブック、ポッドキャスト、動画のナレーションを作成する
  • スタイルや感情を調整できる多言語 TTS を作成する
  • 短い音声サンプルから任意の声をクローンする
  • テキストの説明からカスタムボイスをデザインする

クイックスタート

インストール
pip install mlx-audio
brew install ffmpeg
基本的な使い方
python scripts/run_tts.py custom-voice \
  --text "Hello, welcome to local text to speech." \
  --voice Ryan \
  --output output.wav
スタイルを調整する
python scripts/run_tts.py custom-voice \
  --text "Breaking news: local AI model achieves human-level speech." \
  --voice Uncle_Fu \
  --instruct "news anchor tone, calm and authoritative" \
  --output news.wav

モデルの種類

種類モデルサイズメモリ用途
CustomVoicemlx-community/Qwen3-TTS-12Hz-0.6B-CustomVoice-4bit約1GB約4GB内蔵ボイス+スタイル調整(推奨)
VoiceDesignmlx-community/Qwen3-TTS-12Hz-1.7B-VoiceDesign-5bit約2GB約5GBテキストの説明からボイスを作成
Basemlx-community/Qwen3-TTS-12Hz-0.6B-Base-4bit約1GB約4GB参照音声からボイスをクローン

対応言語

言語コード備考
自動検出autoデフォルト。テキストから検出します
中国語Chinese標準中国語
英語English
日本語Japanese
韓国語Korean
フランス語French
ドイツ語German
スペイン語Spanish
ポルトガル語Portuguese
イタリア語Italian
ロシア語Russian

内蔵ボイス

ボイス言語特徴
Vivian中国語女性、明るく若々しい
Serena中国語女性、穏やかで柔らかい
Uncle_Fu中国語男性、威厳があり、ニュースキャスター風
Dylan中国語男性、北京方言
Eric中国語男性、四川方言
Ryan英語男性、エネルギッシュ
Aiden英語男性、明瞭でニュートラル
Ono_Anna日本語女性
Sohee韓国語女性

ボイス選択ガイド:

場面おすすめのボイス
中国語のニュース/ナレーションUncle_Fu
中国語のカジュアル/活気のあるコンテンツEric
中国語の女性、プロフェッショナルな雰囲気Vivian
中国語の女性、ストーリーテリングSerena
英語のエネルギッシュなコンテンツRyan
英語のニュートラル/教育的なコンテンツAiden
日本語のコンテンツOno_Anna
韓国語のコンテンツSohee

モード

1) CustomVoice

内蔵ボイスを使用します。--instruct で感情やスタイルを調整することもできます。

python scripts/run_tts.py custom-voice \
  --text "This is amazing news!" \
  --voice Vivian \
  --instruct "excited and happy" \
  --output excited.wav

スタイル指示の例:

  • "calm and warm" - 柔らかく親しみやすい話し方
  • "news anchor, authoritative" - プロフェッショナルな放送スタイル
  • "excited and energetic" - エネルギッシュで熱意のある話し方
  • "sad and melancholic" - 感情的で沈んだトーン
  • "whispering, intimate" - 静かで、マイクに近い話し方
2) VoiceDesign

自然言語で説明して、まったく新しいボイスを作成します。

python scripts/run_tts.py voice-design \
  --text "Welcome to our podcast." \
  --instruct "warm, mature male narrator with low pitch and gentle tone" \
  --output podcast_intro.wav

ボイスの説明例:

  • "young cheerful female with high pitch"
  • "elderly wise male with deep resonant voice"
  • "professional female news anchor, clear articulation"
  • "friendly young male, casual and relaxed"
3) VoiceClone

参照音声サンプルから任意の声をクローンします(5~10 秒を推奨)。

python scripts/run_tts.py voice-clone \
  --text "This is my cloned voice speaking new content." \
  --ref_audio reference.wav \
  --ref_text "The exact transcript of the reference audio" \
  --output cloned.wav

ボイスクローンのヒント:

  • 背景ノイズのないクリアな音声を使用する
  • 5~10 秒の音声が最適です
  • 参照音声の正確な書き起こしを用意する
  • 参照音声と出力の言語を一致させる

CLI パラメーター

パラメーター必須デフォルト説明
--textはい-合成するテキスト
--voiceいいえVivian組み込み音声(CustomVoice のみ)
--lang_codeいいえauto言語コード
--instructいいえ-スタイル制御または音声の説明
--speedいいえ1.0音声速度の倍率
--temperatureいいえ0.7サンプリング温度(値が高いほど変化が大きくなります)
--modelいいえ(モードごと)デフォルトモデルを上書きします
--outputいいえ-出力ファイルのパス
--out-dirいいえ./outputs--output が設定されていない場合の出力ディレクトリ
--ref_audioVoiceClone-参照音声ファイル
--ref_textVoiceClone-参照音声の書き起こし

Python API

generate_audio を使用する(推奨)
from mlx_audio.tts.generate import generate_audio

# CustomVoice with style control
generate_audio(
    text="Hello from Qwen3-TTS!",
    model="mlx-community/Qwen3-TTS-12Hz-0.6B-CustomVoice-4bit",
    voice="Ryan",
    lang_code="english",
    instruct="friendly and warm",
    output_path=".",
    file_prefix="hello",
    audio_format="wav",
    join_audio=True,
    verbose=True,
)
Model を直接使用する
from mlx_audio.tts.utils import load
import soundfile as sf
import numpy as np

# Load model
model = load("mlx-community/Qwen3-TTS-12Hz-0.6B-CustomVoice-4bit")

# Generate audio (returns a generator)
audio_chunks = []
for chunk in model.generate_custom_voice(
    text="Hello from Qwen3-TTS.",
    speaker="Ryan",
    language="english",
    instruct="clear, steady delivery"
):
    if hasattr(chunk, 'audio') and chunk.audio is not None:
        audio_chunks.append(chunk.audio)

# Combine and save
audio = np.concatenate(audio_chunks)
sf.write("output.wav", audio, 24000)
VoiceDesign
from mlx_audio.tts.generate import generate_audio

generate_audio(
    text="Welcome to the show.",
    model="mlx-community/Qwen3-TTS-12Hz-1.7B-VoiceDesign-5bit",
    instruct="warm, friendly female narrator with medium pitch",
    lang_code="english",
    output_path=".",
    file_prefix="voice_design",
    join_audio=True,
)
VoiceClone
from mlx_audio.tts.generate import generate_audio

generate_audio(
    text="New content in the cloned voice.",
    model="mlx-community/Qwen3-TTS-12Hz-0.6B-Base-4bit",
    ref_audio="reference.wav",
    ref_text="Transcript of the reference audio",
    output_path=".",
    file_prefix="cloned",
    join_audio=True,
)

バッチ処理

複数の行を処理するには、scripts/batch_dubbing.py を使用します。

python scripts/batch_dubbing.py \
  --input dubbing.json \
  --out-dir outputs

JSON 形式については、references/dubbing_format.md を参照してください。

パフォーマンス

指標値
サンプルレート24,000 Hz
リアルタイム係数約 0.7x(リアルタイムより高速)
ピークメモリ約 4~6 GB
初回実行モデルをダウンロードします(約 1~2GB)

トラブルシューティング

問題解決策
生成が遅い4-bit CustomVoice モデルを使用します
不自然な間句読点を追加し、文を短くします
言語が誤って検出される--lang_code を明示的に指定します
音声クローンの品質よりクリアな参照音声と、正確な書き起こしを使用します
トークナイザーの警告無害なので、無視できます
メモリ不足他のアプリを終了し、4-bit モデルを使用します

コメント