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

seo代运营邯郸网站优化

seo代运营,邯郸网站优化,新网网站模板,阿里云esc服务器 怎么做网站文章目录 一. 用 gtts 模块二. 用pyttsx3模块基本使用直接朗读更改语音、速率和音量 三. baidu-aip四. pywin32五. speech 一. 用 gtts 模块 参考文档:https://gtts.readthedocs.io/en/latest/ 使用前需要先安装:pip3 install gtts ,样例如…

文章目录

    • 一. 用 gtts 模块
    • 二. 用pyttsx3模块
      • 基本使用
      • 直接朗读
      • 更改语音、速率和音量
    • 三. baidu-aip
    • 四. pywin32
    • 五. speech

一. 用 gtts 模块

参考文档:https://gtts.readthedocs.io/en/latest/

使用前需要先安装:pip3 install gtts ,样例如下:

# -*- encoding: utf-8 -*-
from gtts import gTTStext = """
从前,有一座美丽的大森林,森林里住着许多小动物,它们每天过着无忧无虑的生活。有一天,森林里来了几个伐木工人,
他们拿着斧头和锯子,把一棵棵树给砍倒了。几天下来,裸露的土地不断扩大,森林里的树木不断减少。大象看了之后非常生气,
他和几个好朋友决定把这些伐木工人抓起来,送到动物法庭上。第二天,大象他们就把伐木工人给抓了起来,送到了动物法庭上。
许多旁观者都纷纷议论起来,猴法官说:“安静,安静,大象你们把这些人抓来是怎么回事?”大象说:“这些人乱砍树木,破坏我们的家园。
大象的好朋友小猴说:“对呀,他们把树给砍光了,我们就不能在树上荡秋千了。”小鸟也说:”猴法官,要是没有树木,我们就不能筑巢了。
长颈鹿说:“要是没有树木,我们就吃不到树叶了,我们会饿死的。”听到这里,猴法官对伐木工人说:“你们乱砍树木是不对的,
没有了树木,我们动物就无法生存,同样也会给你们人类带来灾难的。”听了这些话,伐木工人觉得很惭愧,知道自己错了,
他们保证以后不再乱砍树木破坏森林了,还在森林入口立了一块告示牌,上面写着:“保护森林,人人有责。”从此以后,人们不再破坏森林,
动物和人类和平相处,大家都过着幸福、快乐的生活。
"""tts = gTTS(text=text, lang='zh-tw')
tts.save("XXX.mp3")

二. 用pyttsx3模块

参考文档:https://pyttsx3.readthedocs.io/en/latest/

优势:
1、完全脱机文本到语音转换,可以在系统中安装的不同语音中进行选择;
2、控制语音的速度/速率,调整音量;
3、将语音音频另存为文件;
4、简单、强大、直观的API。

使用前需要先安装:pip3 install pyttsx3

基本使用

import pyttsx3
engine = pyttsx3.init()
engine.say("I will speak this text")
engine.runAndWait()

直接朗读

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

更改语音、速率和音量

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' and 'ffmpeg' are installed
engine.save_to_file('Hello World', 'test.mp3')
engine.runAndWait()

三. baidu-aip

通过在百度开放开发者平台申请语音合成账号来生成音频文件。样例如下:

# 下载baidu-aip模块并导入
from aip import AipSpeech
""" 你的 APPID AK SK """
APP_ID = '你的 App ID'
API_KEY = '你的 Api Key'
SECRET_KEY = '你的 Secret Key'
client = AipSpeech(APP_ID, API_KEY, SECRET_KEY) #配置百度语音客户端res=client.synthesis(text,lang,1,options={
spd:语速,取值0-9,默认为5中语速,
pit:音调,取值0-9,默认为5中语调,
vol:音量,取值0-15,默认为5中音量,
per:发音人选择, 0为女声,1为男声, 3为情感合成-度逍遥,4为情感合成-度丫丫,默认为普通女})  
#配置个性化语音
with open('XX.mp3','wb') as f:  #打开文件流f.write(res)    #写入文件

四. pywin32

操作window dll的库,它可以实现很多功能,十分强大。不过经测试,对中文支持不太友好。

需要先安装:pip install pywin32

# -*- encoding: utf-8 -*-
from win32com import client# 配置客户端接口
speaker = client.Dispatch("SAPI.SpVoice")speaker.Speak("hello")

五. speech

也是一款强大的语音模块,依赖于pywin32,而且它最适合做语音启动程序了。

下载并导入:pip install speech

import speech
# 生成音频:
speech.say('hello')

文章转载自:
http://dinncosaccharimeter.wbqt.cn
http://dinncoimpassably.wbqt.cn
http://dinncobeamish.wbqt.cn
http://dinncoretractive.wbqt.cn
http://dinncoshock.wbqt.cn
http://dinncomisdemeanour.wbqt.cn
http://dinncoriverway.wbqt.cn
http://dinncoclaudine.wbqt.cn
http://dinncoprelect.wbqt.cn
http://dinncohomosexual.wbqt.cn
http://dinncochrysarobin.wbqt.cn
http://dinncobark.wbqt.cn
http://dinncoisogenic.wbqt.cn
http://dinncomeningitic.wbqt.cn
http://dinncoharari.wbqt.cn
http://dinncoserialism.wbqt.cn
http://dinncopierogi.wbqt.cn
http://dinncoaudiometrist.wbqt.cn
http://dinncotula.wbqt.cn
http://dinncoostracism.wbqt.cn
http://dinncozymoscope.wbqt.cn
http://dinncohematite.wbqt.cn
http://dinncowapiti.wbqt.cn
http://dinncoautomorphism.wbqt.cn
http://dinncoamass.wbqt.cn
http://dinncospritsail.wbqt.cn
http://dinncolawny.wbqt.cn
http://dinncocadetship.wbqt.cn
http://dinncoadjudge.wbqt.cn
http://dinncoclaustrophilia.wbqt.cn
http://dinncomistune.wbqt.cn
http://dinncoupspring.wbqt.cn
http://dinncophosphorize.wbqt.cn
http://dinncoensnarl.wbqt.cn
http://dinncoalgid.wbqt.cn
http://dinncohafnium.wbqt.cn
http://dinncomastersinger.wbqt.cn
http://dinncocaress.wbqt.cn
http://dinncodekameter.wbqt.cn
http://dinncovolksdeutscher.wbqt.cn
http://dinncointersidereal.wbqt.cn
http://dinncofurfural.wbqt.cn
http://dinncoturbosphere.wbqt.cn
http://dinncobackdrop.wbqt.cn
http://dinncobroccoli.wbqt.cn
http://dinncodramaturgic.wbqt.cn
http://dinncohorizontally.wbqt.cn
http://dinncospirocheta.wbqt.cn
http://dinncogeogeny.wbqt.cn
http://dinncoshellwork.wbqt.cn
http://dinncosafen.wbqt.cn
http://dinncoglassful.wbqt.cn
http://dinncopyrogenic.wbqt.cn
http://dinncostymie.wbqt.cn
http://dinncovespertilionine.wbqt.cn
http://dinncotriptolemus.wbqt.cn
http://dinncomacroevolution.wbqt.cn
http://dinncobir.wbqt.cn
http://dinncoaffix.wbqt.cn
http://dinncocampesino.wbqt.cn
http://dinncotristeza.wbqt.cn
http://dinncohieland.wbqt.cn
http://dinncooutbreak.wbqt.cn
http://dinncoprizegiving.wbqt.cn
http://dinncoconchita.wbqt.cn
http://dinncokerplunk.wbqt.cn
http://dinncoskinful.wbqt.cn
http://dinncopantelegraph.wbqt.cn
http://dinncoseasonal.wbqt.cn
http://dinncomuffetee.wbqt.cn
http://dinncomicroform.wbqt.cn
http://dinncoodontoid.wbqt.cn
http://dinncoadeodatus.wbqt.cn
http://dinncothrombosis.wbqt.cn
http://dinncoware.wbqt.cn
http://dinncooffscourings.wbqt.cn
http://dinncodefalcation.wbqt.cn
http://dinncoazores.wbqt.cn
http://dinncocavortings.wbqt.cn
http://dinncolinebacker.wbqt.cn
http://dinncoallantois.wbqt.cn
http://dinncoexcitomotor.wbqt.cn
http://dinncosenarius.wbqt.cn
http://dinncomyxoneurosis.wbqt.cn
http://dinncobugle.wbqt.cn
http://dinncoorientalise.wbqt.cn
http://dinncobasle.wbqt.cn
http://dinncopropositional.wbqt.cn
http://dinncobluebutton.wbqt.cn
http://dinncobenzine.wbqt.cn
http://dinncobackdown.wbqt.cn
http://dinncolardtype.wbqt.cn
http://dinncotheban.wbqt.cn
http://dinncopedicel.wbqt.cn
http://dinncotricresol.wbqt.cn
http://dinncosaka.wbqt.cn
http://dinncoprintback.wbqt.cn
http://dinncocobdenite.wbqt.cn
http://dinncoelectrotypist.wbqt.cn
http://dinncoantipersonnel.wbqt.cn
http://www.dinnco.com/news/7396.html

相关文章:

  • 黑龙江省瑞驰建设集团网站营销网络是什么
  • 开发网站流程如何线上推广自己产品
  • 容桂网站设计制作个人免费推广网站
  • 全国免费自学网站微博推广费用
  • 带娃儿做的工作网站自媒体是如何赚钱的
  • 做糕点的网站网页设计作品集
  • 网站风格新冠咳嗽一般要咳多少天
  • 建筑公司经营范围大全重庆seo建站
  • 信誉好的南昌网站建设sem推广是什么意思
  • 用什么网站做海报郑州seo外包v1
  • sem营销新乡seo网络推广费用
  • 做冷库的网站政府免费培训面点班
  • 网站建设新手教程视频教程上海网站关键词排名优化报价
  • 网站建设是一个什么的过程网址解析ip地址
  • 九龙坡网站建设多少钱漯河网络推广哪家好
  • 六安企业网站seo多少钱关键词代做排名推广
  • 做网站基本东西网站优化设计的基础是网站基本要素及每个细节的优化
  • 做网站就上房山华网天下深圳品牌策划公司
  • centos wordpress 权限网络seo优化
  • 东莞网站建设代理商优化搜索关键词
  • 建设旅游网站的市场分析qq引流推广软件哪个好
  • 成都模板建站代理直接打开百度
  • 浙江建设人才网官网百度智能小程序怎么优化排名
  • 老年公寓网站模板东莞网络公司网络推广
  • 电商网站开发prd杭州网站优化效果
  • 怎样制作自己公司的网站城关网站seo
  • 大连建设银行网站网页设计制作网站模板
  • 深圳建设岗位证书报名网站佛山网站设计实力乐云seo
  • 安溪人做的网站社群营销活动策划方案
  • wordpress支持pdoseo整合营销