0
A
回答
1
呃,你應該使用engine.setProperty('voice', voice_id)
(與voice_id
是在您的系統聲音的ID,你可以抓住一個可用聲音從engine.getProperty('voices')
名單)作爲that example建議:
engine = pyttsx.init()
voices = engine.getProperty('voices')
for voice in voices:
engine.setProperty('voice', voice.id) # changes the voice
engine.say('The quick brown fox jumped over the lazy dog.')
engine.runAndWait()
你不必須循環,您可以在沒有for
循環的情況下設置語音ID。
就那樣做:
engine = pyttsx.init()
engine.setProperty('voice', voice_id) # use whatever voice_id you'd like
engine.say('The quick brown fox jumped over the lazy dog.')
5
import pyttsx
engine = pyttsx.init()
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[0].id) #change index to change voices
engine.say('I'm a little teapot...')
engine.runAndWait()
相關問題
- 1. python:更改pyttsx縮寫
- 2. Pyttsx音性別
- 3. 如何在python上結合語音識別和pyttsx 2.7
- 4. python模塊更改問題
- 5. pyttsx for Python 3.4
- 6. Python的音樂模塊
- 7. 在語音API中更改語音語音
- 8. Pyttsx不產生聲音
- 9. 使用AVAudioPlayer更改語音音高
- 10. Python在另一個模塊中更改模塊變量
- 11. Python模塊語義與其C-API中的Ruby模塊語義
- 12. 如何用Python模塊Dragonfly識別語音?
- 13. 如何將文本中的語音更改爲語音識別?
- 14. Python:更改音頻文件的音高
- 15. Python - 如何更改模塊實現?
- 16. 如何更改python模塊路徑
- 17. 如何更改Python模塊名稱?
- 18. 帶語音識別模塊的Arduino
- 19. Python pyttsx阻止了Tkinter中的程序
- 20. Python模塊更新
- 21. 更新python模塊
- 22. 更改Android的文本到語音的默認語音
- 23. 良好的Python 2音頻模塊
- 24. 在android tts中更改默認語音?
- 25. 在android中更改語音調製
- 26. 如何在DNN 6中更改語言時更改模塊的內容?
- 27. 如何防止pyttsx在與pygame一起使用時產生破碎的語音?
- 28. 檢查所有導入的Python模塊中的代碼更改
- 29. JSF表單和德語變音模塊
- 30. Python pyttsx,如何使用外部循環
謝謝,這是我試過,但所有目前存在的聲音ID的聲音完全一樣,想知道如果我錯過了一些東西明顯。 – 2015-02-05 13:42:45