edge tts go
v0.1.0
edge-tts-go是一個Golang模塊,可讓您在Golang代碼中或使用提供的edge-tts-go命令中使用Microsoft Edge的在線文本對語音服務。
要安裝它,請運行以下命令:
$ go install github.com/surfaceyu/edge-tts-go
如果要使用edge-tts-go命令,則可以使用以下命令運行它:
$ edge-tts-go --text "Hello, world!" --write-media hello.mp3
如果您想更改演講的語言或更一般的語音。
您必須首先檢查帶有--list-voices選項的可用聲音:
$ edge-tts-go --list-voices
Name: Microsoft Server Speech Text to Speech Voice (af-ZA, AdriNeural)
ShortName: af-ZA-AdriNeural
Gender: Female
Locale: af-ZA
Name: Microsoft Server Speech Text to Speech Voice (am-ET, MekdesNeural)
ShortName: am-ET-MekdesNeural
Gender: Female
Locale: am-ET
Name: Microsoft Server Speech Text to Speech Voice (ar-EG, SalmaNeural)
ShortName: ar-EG-SalmaNeural
Gender: Female
Locale: ar-EG
Name: Microsoft Server Speech Text to Speech Voice (ar-SA, ZariyahNeural)
ShortName: ar-SA-ZariyahNeural
Gender: Female
Locale: ar-SA
...
$ edge-tts-go --voice zh-CN-XiaoxiaoNeural --text "秦时明月汉时关,万里长征人未还" --write-media hello_in_chinese.mp3
可以對生成的語音進行小改動。
$ edge-tts-go --rate=-50% --text "Hello, world!" --write-media hello_with_rate_halved.mp3
$ edge-tts-go --volume=-50% --text "Hello, world!" --write-media hello_with_volume_halved.mp3
可以直接從GO中使用edge-tts-go模塊。對於示例應用程序列表: