LoginSignup
1
0

macでVoicePeakをコマンド実行&Python

Last updated at Posted at 2024-01-05

VoicePeak

macでVoicePeakをコマンド実行&Python

随時付け足し

command
/Applications/voicepeak.app/Contents/MacOS/voicepeak voicepeak -s "こんにちわ" -o "/Users/~各自のパス~/output.wav" -n "Japanese Male 3" -e happy=50,sad=0,fun=0,angry=0
help
  -s, --say Text               Text to say
  -t, --text File              Text file to say
  -o, --out File               Path of output file
  -n, --narrator Name          Name of voice, check --list-narrator
  -e, --emotion Expr           Emotion expression, for example: 
                               happy=50,sad=50. Also check --list-emotion
      --list-narrator          Print voice list
      --list-emotion Narrator  Print emotion list for given voice
  -h, --help                   Print help
      --speed Value            Speed (50 - 200)
      --pitch Value            Pitch (-300 - 300)

vp.py
import os
import sys
import subprocess
import platform

# voicepeak.exeのパス
exepath = "/Applications/voicepeak.app/Contents/MacOS/voicepeak"

# wav出力先
outpath = "/Users/~各自のパス~/output.wav"

script = "こんにちわ"
narrator = "Japanese Female 1"
happy=50
sad=50
angry=50
fun=50

# 引数を作成
args = [
        exepath,
        "-s", script,
        "-n", narrator,
        "-o", outpath,
        "-e", f"happy={happy},sad={sad},angry={angry},fun={fun}"
    ]

# プロセスを実行
process = subprocess.Popen(args)

# プロセスが終了するまで待機
process.communicate()
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0