CLIリファレンス

speechバイナリは、すべての音声処理タスクのメインエントリーポイントです。make buildでビルド後、.build/release/speechから実行します。

transcribe

音声ファイルをテキストに文字起こしします。

speech transcribe <file> [options]
オプションデフォルト説明
<file>文字起こしする音声ファイル(WAV、M4A、MP3、CAF)
--engineqwen3ASRエンジン: qwen3qwen3-coremlparakeetnemotron、または omnilingual
--model, -m0.6Bモデルバリアント: 0.6B1.7B、またはHuggingFace完全モデルID(qwen3のみ)
--language言語ヒント(オプション、omnilingualでは無視)
--window10[omnilingual] CoreMLウィンドウサイズ(秒): 5 または 10
--backendcoreml[omnilingual] バックエンド: coreml(Neural Engine)または mlx(Metal GPU)
--variant300M[omnilingual mlx] サイズ: 300M1B3B、または 7B
--bits4[omnilingual mlx] 量子化ビット: 4 または 8
--streamVAD付きストリーミング文字起こしを有効化
--max-segment10最大セグメント長(秒、streaming時)
--partial発話中に部分結果を出力(streaming時)

例:

# 基本的な文字起こし
speech transcribe recording.wav

# より大きなモデルを使用
speech transcribe recording.wav --model 1.7B

# CoreMLエンコーダー(Neural Engine + MLXデコーダー)
speech transcribe recording.wav --engine qwen3-coreml

# Parakeet(CoreML)エンジンを使用
speech transcribe recording.wav --engine parakeet

# Omnilingual(CoreML、1,672言語)
speech transcribe recording.wav --engine omnilingual                              # 10秒ウィンドウ
speech transcribe recording.wav --engine omnilingual --window 5                     # 5秒ウィンドウ

# Omnilingual(MLX、最大40秒まで任意の長さ)
speech transcribe recording.wav --engine omnilingual --backend mlx                              # 300M @ 4-bit
speech transcribe recording.wav --engine omnilingual --backend mlx --variant 1B                  # 1B @ 4-bit
speech transcribe recording.wav --engine omnilingual --backend mlx --variant 3B --bits 8         # 3B @ 8-bit
speech transcribe recording.wav --engine omnilingual --backend mlx --variant 7B                  # 7B @ 4-bit

# VAD付きストリーミング
speech transcribe recording.wav --stream --partial

align

単語レベルの強制整列 — すべての単語の正確なタイムスタンプを取得します。

speech align <file> [options]
オプションデフォルト説明
<file>音声ファイル
--text, -t整列するテキスト(省略時は最初に文字起こし)
--model, -m0.6B文字起こし用ASRモデル: 0.6B1.7B、または完全ID
--aligner-model強制整列モデルID
--language言語ヒント

例:

# 自動文字起こし後に整列
speech align recording.wav

# 既知のテキストで整列
speech align recording.wav --text "Can you guarantee that the replacement part will be shipped tomorrow?"

speak

音声合成。

speech speak "<text>" [options]
オプションデフォルト説明
<text>合成するテキスト(--batch-file使用時はオプション)
--engineqwen3TTSエンジン: qwen3 または cosyvoice
--output, -ooutput.wav出力WAVファイルパス
--languageenglish言語。--speaker設定時は省略すると話者のネイティブ方言を使用します。
--streamストリーミング合成を有効化
--voice-sample音声クローン用のリファレンス音声(qwen3cosyvoiceの両エンジンで動作)
--verbose詳細なタイミング情報を表示

Qwen3-TTSオプション

オプションデフォルト説明
--modelbaseモデルバリアント: basecustomVoice、またはHF完全モデルID
--speaker話者音声(--model customVoiceが必要)
--instructスタイル指示(CustomVoiceモデル)
--list-speakers利用可能な話者を一覧表示して終了
--temperature0.3サンプリング温度
--top-k50top-kサンプリング
--max-tokens500最大トークン数(500 = 約40秒の音声)
--batch-fileバッチ合成用の1行1テキストファイル
--batch-size4並列生成の最大バッチサイズ
--first-chunk-frames3ストリーム最初のchunkのコーデックフレーム数
--chunk-frames25ストリームchunkあたりのコーデックフレーム数

CosyVoice3オプション

オプションデフォルト説明
--speakersマルチ話者対話の話者マッピング: s1=alice.wav,s2=bob.wav
--cosy-instructスタイル指示(デフォルトを上書き)。CosyVoice3の音声スタイルを制御します。
--turn-gap0.2対話ターン間の無音ギャップ(秒)
--crossfade0.0ターン間のクロスフェードオーバーラップ(秒)
--model-idHuggingFaceモデルID

例:

# 基本的なTTS
speech speak "Hello, world!" --output hello.wav

# 音声クローン(Qwen3-TTS)
speech speak "Hello in your voice" --voice-sample reference.wav -o cloned.wav

# 音声クローン(CosyVoice)
speech speak "Hello in your voice" --engine cosyvoice --voice-sample reference.wav -o cloned.wav

# CosyVoice多言語
speech speak "Hallo Welt" --engine cosyvoice --language german -o hallo.wav

# マルチ話者対話
speech speak "[S1] Hello there! [S2] Hey, how are you?" \
    --engine cosyvoice --speakers s1=alice.wav,s2=bob.wav -o dialogue.wav

# インライン感情/スタイルタグ
speech speak "(excited) Wow, amazing! (sad) But I have to go..." \
    --engine cosyvoice -o emotion.wav

# 組み合わせ: 対話 + 感情 + 音声クローン
speech speak "[S1] (happy) Great news! [S2] (surprised) Really?" \
    --engine cosyvoice --speakers s1=alice.wav,s2=bob.wav -o combined.wav

# カスタムスタイル指示
speech speak "Hello world" --engine cosyvoice --cosy-instruct "Speak cheerfully" -o cheerful.wav

# ストリーミング合成
speech speak "Long text here..." --stream

# ファイルからバッチ合成
speech speak --batch-file texts.txt --batch-size 4

kokoro

Neural Engine(CoreML)上でKokoro-82Mを使用する軽量音声合成。非自己回帰型 — 単一のforward pass、約45msのレイテンシ。

speech kokoro "<text>" [options]
オプションデフォルト説明
<text>合成するテキスト
--voiceaf_heartボイスプリセット(10言語にわたる50種類が利用可能)
--languageen言語コード: en、es、fr、hi、it、ja、pt、zh、ko、de
--output, -okokoro_output.wav出力WAVファイルパス
--list-voices利用可能なすべてのボイスを一覧表示して終了
--model, -mHuggingFaceモデルID

例:

# 基本的なKokoro TTS
speech kokoro "Hello, world!" --voice af_heart -o hello.wav

# フランス語のボイス
speech kokoro "Bonjour le monde" --voice ff_siwis --language fr -o bonjour.wav

# 全50ボイスを一覧表示
speech kokoro --list-voices

respond

PersonaPlex 7Bを使用したfull-duplex音声間対話。

speech respond [options]
オプションデフォルト説明
--input, -i入力音声WAVファイル(24kHzモノラル)(必須)
--output, -oresponse.wav出力レスポンスWAVファイル
--voiceNATM0ボイスプリセット(例: NATM0、NATF1、VARF0)
--system-promptassistantプリセット: assistantfocusedcustomer-serviceteacher
--system-prompt-textカスタムシステムプロンプトテキスト(プリセットを上書き)
--max-steps20012.5Hzでの最大生成ステップ(約16秒)
--stream生成中に音声chunksを出力
--compileコンパイル済みtransformerを有効化(ウォームアップ + カーネル融合)
--list-voices利用可能なボイスプリセットを一覧表示
--list-prompts利用可能なシステムプロンプトプリセットを一覧表示
--transcriptモデルの内部モノローグテキストを出力
--jsonJSON形式で出力(transcript、レイテンシ、音声パス)
--verbose詳細なタイミング情報を表示

サンプリングの上書き

オプションデフォルト説明
--audio-temp0.8音声サンプリング温度
--text-temp0.7テキストサンプリング温度
--audio-top-k250音声top-k候補
--repetition-penalty1.2音声反復ペナルティ(1.0 = 無効)
--text-repetition-penalty1.2テキスト反復ペナルティ(1.0 = 無効)
--repetition-window30反復ペナルティウィンドウ(フレーム)
--silence-early-stop15早期停止前の無音フレーム(0 = 無効)
--entropy-threshold0早期停止用のテキストエントロピー閾値(0 = 無効)
--entropy-window10早期停止前の連続低エントロピーステップ数

例:

# 基本的な音声間変換
speech respond --input question.wav

# コンパイル済みtransformerで女性ボイスを使用
speech respond -i question.wav --voice NATF1 --compile

# レスポンスをstreamingし、transcriptを表示
speech respond -i question.wav --stream --transcript --verbose

vad

Pyannoteセグメンテーションを使用したオフラインの音声区間検出。

speech vad <file> [options]
オプション説明
<file>解析する音声ファイル
--model, -mHuggingFaceモデルID
--onset開始閾値(発話開始)
--offset終了閾値(発話終了)
--min-speech最小発話時間(秒)
--min-silence最小無音時間(秒)
--jsonJSON形式で出力

vad-stream

Silero VAD v5を使用したストリーミング音声区間検出。32msチャンクで音声を処理します。

speech vad-stream <file> [options]
オプション説明
<file>解析する音声ファイル
--engineVADエンジン: mlx(デフォルト)または coreml
--model, -mHuggingFaceモデルID(エンジンに基づいて自動選択)
--onset開始閾値
--offset終了閾値
--min-speech最小発話時間(秒)
--min-silence最小無音時間(秒)
--jsonJSON形式で出力

wake

KWS Zipformer を使用したオンデバイスのキーワード検出(3.49Mパラメータ、CoreML INT8、リアルタイムの26倍、英語のみ)。

speech wake <file> [options]
オプション説明
<file>解析する音声ファイル
--keywords1つ以上のキーワード。フォーマット:"hey soniqo""hey soniqo:0.15:0.5"、または "LIGHT UP|▁ L IGHT ▁UP:0.25:2.0"(sherpa-onnx形式の明示的なBPEピース)
--keywords-fileキーワードファイル、1行1エントリ
--model, -mHuggingFaceモデルID。デフォルト:aufklarer/KWS-Zipformer-3M-CoreML-INT8
--jsonJSON形式で出力

diarize

話者ダイアライゼーション — 誰がいつ話したかを識別します。

speech diarize <file> [options]
オプションデフォルト説明
<file>解析する音声ファイル
--enginepyannoteダイアライゼーションエンジン: pyannote(セグメンテーション + 話者チェイニング)または sortformer(エンドツーエンドCoreML)
--target-speaker対象話者抽出用の登録音声(pyannoteのみ)
--embedding-enginemlx話者embeddingエンジン: mlx または coreml(pyannoteのみ)
--vad-filterSilero VADで事前フィルタ(pyannoteのみ)
--rttmRTTM形式で出力
--jsonJSON形式で出力
--score-againstDER計算用のリファレンスRTTMファイル

例:

# 基本的なダイアライゼーション(pyannote、デフォルト)
speech diarize meeting.wav

# エンドツーエンドSortformer(CoreML、Neural Engine)
speech diarize meeting.wav --engine sortformer

# 評価用のRTTM出力
speech diarize meeting.wav --rttm

# 対象話者抽出(pyannoteのみ)
speech diarize meeting.wav --target-speaker enrollment.wav

# リファレンスに対してスコアリング
speech diarize meeting.wav --score-against reference.rttm

embed-speaker

音声から話者embeddingベクトルを抽出します。

speech embed-speaker <file> [options]
オプション説明
<file>話者の声を含む音声ファイル
--engine推論エンジン: mlx(デフォルト)、coreml(WeSpeaker 256次元)、または camplusplus(CAM++ CoreML 192次元)
--jsonJSON形式で出力

denoise

Neural Engine上のDeepFilterNet3を使用して背景ノイズを除去します。

speech denoise <file> [options]
オプションデフォルト説明
<file>入力音声ファイル
--output, -oinput_clean.wav出力ファイルパス
--model, -mHuggingFaceモデルID

例:

speech denoise noisy-recording.wav -o clean.wav

compose

Generate 30 s of music from a text prompt using MAGNeT on MLX.

speech compose <prompt> [options]
OptionDefaultDescription
<prompt>Text prompt describing the music to generate (e.g. "happy rock")
--output, -omagnet.wavOutput WAV path (32 kHz mono)
--variantsmall-int4Model variant: small-int4, small-int8, medium-int4, or medium-int8. Resolves to aufklarer/MAGNeT-{Small,Medium}-30secs-MLX-{4,8}bit.
--temperature3.0Sampling temperature, annealed linearly per stage.
--top-p0.9Nucleus sampling threshold.
--cfg-max10.0Max classifier-free guidance coefficient.
--cfg-min1.0Min CFG coefficient (annealed alongside the mask schedule).
--steps20,10,10,10Comma-separated decoding iterations per codebook (4 values).
--seedRandom seed for reproducible output.

Examples:

# Default: small-int4, ~10 s wall on M-series for a 30 s clip
speech compose "happy rock" -o happy_rock.wav

# Larger model — better prompt following, slower
speech compose "lo-fi hip hop with mellow piano" --variant medium-int4 -o lofi.wav

# Reproducible
speech compose "energetic EDM with synth lead" --seed 42 -o edm.wav