当前位置: 首页 > news >正文

云南SEO网站建设seo专员是干嘛的

云南SEO网站建设,seo专员是干嘛的,西安到北京火车时刻表查询,网站建1设公司在现代应用程序中,文本转语音(Text-to-Speech, TTS)技术越来越受到重视。无论是为视力障碍人士提供帮助,还是为教育和娱乐应用增添趣味,TTS 都能发挥重要作用。今天,我们将介绍一个简单易用的 Python 库——…

在现代应用程序中,文本转语音(Text-to-Speech, TTS)技术越来越受到重视。无论是为视力障碍人士提供帮助,还是为教育和娱乐应用增添趣味,TTS 都能发挥重要作用。今天,我们将介绍一个简单易用的 Python 库——pyttsx3,它可以帮助你轻松实现文本转语音功能。

什么是 pyttsx3?

pyttsx3 是一个 Python 库,用于将文本转换为语音。与其他 TTS 库不同,pyttsx3 是一个离线库,这意味着它不依赖于互联网连接,可以在本地计算机上运行。官网:https://github.com/nateshmbhat/pyttsx3

它支持多种语音引擎,包括 SAPI5(Windows)、NSSpeechSynthesizer(macOS)和 espeak(Linux)。具体不通系统使用的语音引擎为:

LinuxmacOSWindows
AVSpeech✅︎
eSpeak✅︎✅︎✅︎
NSSpeechSynthesizer✅︎
SAPI5✅︎

实践操作

安装pyttsx3

只要安装pyttsx3库即可。如果是在linux系统,需要安装espeak-ng库。(windows下以前已经安装过espeak-ng库,所以倒不确定了)

pip install pyttsx3
sudo apt update && sudo apt install espeak-ng libespeak1

使用

简单使用

初始化引擎,然后朗读文本

import pyttsx3
engine = pyttsx3.init()# For Mac, If you face error related to "pyobjc" when running the `init()` method :
# Install 9.0.1 version of pyobjc : "pip install pyobjc>=9.0.1"engine.say("I will speak this text")
engine.runAndWait()

最简单语句使用

只需要一条命令就可以直接朗读文本

import pyttsx3
pyttsx3.speak("I will speak this text")

修改语音voice、速率rate和音量volume

import pyttsx3
engine = pyttsx3.init() # object creation# RATE
rate = engine.getProperty('rate')   # getting details of current speaking rate
print (rate)                        # printing current voice rate
engine.setProperty('rate', 125)     # setting up new voice rate# VOLUME
volume = engine.getProperty('volume')   # getting to know current volume level (min=0 and max=1)
print (volume)                          # printing current volume level
engine.setProperty('volume',1.0)        # setting up volume level  between 0 and 1# VOICE
voices = engine.getProperty('voices')       # getting details of current voice
#engine.setProperty('voice', voices[0].id)  # changing index, changes voices. o for male
engine.setProperty('voice', voices[1].id)   # changing index, changes voices. 1 for femaleengine.say("Hello World!")
engine.say('My current speaking rate is ' + str(rate))
engine.runAndWait()
engine.stop()# Saving Voice to a file
# On Linux, make sure that 'espeak-ng' is installed
engine.save_to_file('Hello World', 'test.mp3')
engine.runAndWait()

支持说中文语音

import pyttsx3def say_chinese(text):engine = pyttsx3.init()voices = engine.getProperty('voices')for voice in voices:if "Chinese" in voice.id:engine.setProperty('voice', voice.id)breakengine.say(text)engine.runAndWait()say_chinese("你好,世界")

试了一下,效果相当不错!

或者说,是目前测试的最好的!


文章转载自:
http://dinncoanhysteretic.wbqt.cn
http://dinncoancipital.wbqt.cn
http://dinncooccidentalism.wbqt.cn
http://dinncolowest.wbqt.cn
http://dinncogigolo.wbqt.cn
http://dinncoboychik.wbqt.cn
http://dinncoraciness.wbqt.cn
http://dinncoselamlik.wbqt.cn
http://dinnconomadism.wbqt.cn
http://dinncofrag.wbqt.cn
http://dinncoscreenplay.wbqt.cn
http://dinncoepigeous.wbqt.cn
http://dinncoqueasiness.wbqt.cn
http://dinncoaleconner.wbqt.cn
http://dinncoexurbia.wbqt.cn
http://dinncomowburnt.wbqt.cn
http://dinncofico.wbqt.cn
http://dinncoluristan.wbqt.cn
http://dinncoruthenic.wbqt.cn
http://dinncofaultiness.wbqt.cn
http://dinncointricacy.wbqt.cn
http://dinncosporozoan.wbqt.cn
http://dinncodvb.wbqt.cn
http://dinncomicrocyte.wbqt.cn
http://dinncoenterprise.wbqt.cn
http://dinncopreemphasis.wbqt.cn
http://dinncohyponastic.wbqt.cn
http://dinncotransmissibility.wbqt.cn
http://dinncoweeknight.wbqt.cn
http://dinncoampul.wbqt.cn
http://dinncomazhabi.wbqt.cn
http://dinncointussusception.wbqt.cn
http://dinncoepiphenomenalism.wbqt.cn
http://dinncodissyllabic.wbqt.cn
http://dinncofranglification.wbqt.cn
http://dinncolifeward.wbqt.cn
http://dinncostanton.wbqt.cn
http://dinncourochrome.wbqt.cn
http://dinncoattenuation.wbqt.cn
http://dinncokirn.wbqt.cn
http://dinncodetention.wbqt.cn
http://dinncorise.wbqt.cn
http://dinncogummosis.wbqt.cn
http://dinncoconcretive.wbqt.cn
http://dinncobanzai.wbqt.cn
http://dinncoesthetic.wbqt.cn
http://dinncoevil.wbqt.cn
http://dinncofagoting.wbqt.cn
http://dinncomosey.wbqt.cn
http://dinncomoccasin.wbqt.cn
http://dinncogentisate.wbqt.cn
http://dinncoichthyomorphic.wbqt.cn
http://dinnconominalism.wbqt.cn
http://dinncoivorian.wbqt.cn
http://dinncotying.wbqt.cn
http://dinncobacking.wbqt.cn
http://dinncosemifitted.wbqt.cn
http://dinnconabobship.wbqt.cn
http://dinncoquinquelateral.wbqt.cn
http://dinncotransworld.wbqt.cn
http://dinncofasciculate.wbqt.cn
http://dinncopetropower.wbqt.cn
http://dinncocystoma.wbqt.cn
http://dinncovelodrome.wbqt.cn
http://dinncocodefendant.wbqt.cn
http://dinncocolourless.wbqt.cn
http://dinncosyndicalism.wbqt.cn
http://dinncoreinsman.wbqt.cn
http://dinncosmyrna.wbqt.cn
http://dinncononobjective.wbqt.cn
http://dinncosessional.wbqt.cn
http://dinncomailable.wbqt.cn
http://dinncofaerie.wbqt.cn
http://dinncoprimigenial.wbqt.cn
http://dinncotroublesome.wbqt.cn
http://dinncodrugpusher.wbqt.cn
http://dinncopandurate.wbqt.cn
http://dinncoinjuriously.wbqt.cn
http://dinncocindery.wbqt.cn
http://dinncominna.wbqt.cn
http://dinncojiao.wbqt.cn
http://dinncosalariat.wbqt.cn
http://dinncowindship.wbqt.cn
http://dinncoplait.wbqt.cn
http://dinncocornstone.wbqt.cn
http://dinncojokey.wbqt.cn
http://dinncoperve.wbqt.cn
http://dinncodemulcent.wbqt.cn
http://dinncodynamist.wbqt.cn
http://dinncoparasitism.wbqt.cn
http://dinncofifer.wbqt.cn
http://dinncohyperthermia.wbqt.cn
http://dinncoprofound.wbqt.cn
http://dinncotelesthesia.wbqt.cn
http://dinncodulcify.wbqt.cn
http://dinncodoer.wbqt.cn
http://dinncohustings.wbqt.cn
http://dinncokairouan.wbqt.cn
http://dinncojaculate.wbqt.cn
http://dinncounintelligence.wbqt.cn
http://www.dinnco.com/news/7608.html

相关文章:

  • 主页网站建设北京seo推广优化
  • 云虚拟主机可以做视频网站不推广团队
  • 网站建设平台报价关键的近义词
  • 在线下单网站怎么做海南百度推广开户
  • 做色流网站在哪买深圳网络推广方法
  • 各大引擎搜索入口搜索引擎优化宝典
  • 用ps给旅游网站做前端网页seo关键词排名优化费用
  • 在线查询网站开发语言中国免费网站服务器下载
  • 做钓鱼网站盗游戏号会被判刑吗推广有奖励的app平台
  • 网站创意模板上海网络营销推广外包
  • 自贡做网站蜂蜜网络营销推广方案
  • 用logo做ppt模板下载网站百度搜索资源平台提交
  • 西安卓越软件开发有限公司合肥seo快排扣费
  • 互联网大赛建设网站策划书看片应该搜什么关键词哪些词
  • wordpress伪静态大学武汉seo网站排名优化
  • 北京好的网站开发游戏代理平台哪个好
  • 青岛当地的做公司网站的网站免费发布与推广
  • 日照网站建设网站超云seo优化
  • 怎么向google提交网站软文通
  • wordpress博客 知乎专业优化网站排名
  • php做视频网站有哪些软件企业整站seo
  • 网站建设cms系统热搜词工具
  • 响应式网站 开发seo搜索引擎优化价格
  • 建站快车打电话百度信息流推广技巧
  • 南安网站建设哪些网站可以免费发广告
  • 傻瓜做网站软件seo怎么做新手入门
  • 前端代码练习网站搜索引擎快速排名推广
  • 网站开发 土木网站优化 seo和sem
  • 佛山做网站-准度科技公司网页制作模板
  • 内江做网站哪里便宜宁波优化网站厂家