current position：Home>Inventory a voice conversion library
Inventory a voice conversion library
2022-05-15 07:21:10【Python advanced】
Hello everyone , I'm Pippi .
One 、 Preface
A few days ago Python There is a member of Xingyao communication group called 【 Duolong 】 My fans asked Python Library voice conversion problem , Take it out here and share it with you , Let's study together .
This is his element code ：
from gtts import gTTSimport ostts = gTTS(text=" Speak Chinese ha, I think I can read it well ", lang="zh-tw")tts.save("hello1.mp3")
Two 、 To solve the process
This voice library needs to be installed , Installation method （ Additive source ）：pip install -i https://pypi.tuna.tsinghua.edu.cn/simple gTTS.
Otherwise, the following error will be prompted ：
After installation , Run code , There will still be mistakes , Because there is a problem with the original code , There is a parameter wrong , According to the tips on the official website ,lang=zh-TW It's just .
from gtts import gTTSimport ostts = gTTS(text=" Speak Chinese ha, I think I can read it well ", lang="zh-TW")tts.save("hello1.mp3")
But unfortunately , Or an error , As shown in the figure below ：
The reason is this gtts Need to connect to Google Server for , But if you don't surf the Internet scientifically , In fact, you can't visit .
If you can't connect to the Internet , either vpn, Do how? ？
Don't panic , below 【 Mr. Yu Liang 】 The boss gave the solution .
【 Mr. Yu Liang 】 answer
This is 【 Mr. Yu Liang 】 The code given by the boss , Just set the domain name , As shown below ：
from gtts import gTTStts = gTTS(text=" Speak Chinese ha, I think I can read it well ", lang="zh-TW", tld='com.cn')tts.save("hello1.mp3")
In this way, it can be generated smoothly , No need for scientific Internet access can also be converted in actual combat .
Yes, of course ,tld='cn' It's the same , This is calling translate.google.cn, The example above is to call translate.google.com.cn, The added parameter is tld='com.cn'.
The following figure is the official document ：
3、 ... and 、 summary
Hello everyone , I'm Pippi . This article mainly shares a Python Deal with the use of voice conversion library , Specific analysis and code demonstration are given to solve this problem , There are two ways , Help the fans solve the problem smoothly .
More about gTTs Problems with library usage , You can go to the official website ：Module (gtts) — gTTS documentation https://gtts.readthedocs.io/en/latest/module.html#languages-gtts-lang see .
Finally thanks 【 Duolong 】 put questions to , thank 【dcpeng】 and 【 Mr. Yu Liang 】 The specific analysis and code demonstration given by the boss , thank 【 Chen Ma Chen Cheng 】、【 Luna 】、【Lasu】 And others participate in learning and communication .
friends , Practice it quickly ！ If in the process of learning , Any problems encountered , Welcome to add my friend , I'll pull you in Python The learning exchange group discusses learning together .
author[Python advanced],Please bring the original link to reprint, thank you.
The sidebar is recommended
- Redis -- realize the like function
- What are the problems with NoSQL?
- What aspects does the class database of real-time data warehouse include?
- [MQ] achieve mq-08- configuration optimization from scratch fluent
- Rongyun x dsport: win the first drop of blood of game social "real-time community"
- Druid source code reading 5 -- discuss why Druid doesn't use atomiclong
- Construction practice camp - graduation summary
- [module] environment variable management tool module installation and use
- Kernel heap bypass SMEP, SMAP & modprobe_ path
guess what you like
Getting started with mqtt: online debugging and connecting to alicloud
Leetcode deletes the penultimate node of the linked list
Design of Web rights management (1) -- Analysis of key points of design (4)
Tencent cloud database growth index ranked first
Three ways! Go error handling best practices
Live broadcast at 20:00 tomorrow night ｜ open the box Tencent cloud: play lighthouse, novice friendly and light-weight cloud!
New study conclusion: sleeping more than 2 hours on weekends reduces the risk of depression by 48%
Retinal vessel segmentation based on u-net model
Applet X-axis fade in animation component
Explanation of wechat applet interface call (accesstoken, applet code login)
- Single cell column - how to give orig Ident, change your name
- Fonts best practices
- Wonderful express ｜ April issue of Tencent cloud database
- Illustration: what is the difference between layer 2 and layer 3 switches?
- Activity Notice | timing adjustment of 2022 deterministic network technology and Innovation Summit
- In order to seize the capacity of 5nm chips, AMD will pay an advance payment of US $6.5 billion to TSMC, grofangde and other suppliers; Germany will adopt stricter antitrust rules for Google meta
- It is reported that TSMC will promote the 1.4 nm process next month; Taobaoyuan universe trademark rejected
- Online binary 8-hexadecimal conversion tool
- [paper notes] epsanet: an efficient pyramid sequence attention block on revolutionary neural network
- IndexError: shape mismatch: indexing tensors could not be broadcast together with shapes , 
- What are the development stages of time series database in recent years?
- What are the shortcomings of the data model processed in the first stage of time series database?
- What are the shortcomings of the data model processed in the second stage of time series database?
- What are the development trends of time series database?
- What are the characteristics of cloud native multimode database lindorm?
- What are the functions of cloud native multimode database lindorm?
- Variance, standard deviation, mathematical expectation
- Two dimensional Gaussian distribution
- Collaborative process and channels (CSP: kotlin, golang)
- SQLite3 custom function (UDF)
- SQLite3 minimalist Tutorial & go operating data structures using SQLite memory mode
- Penetration test - DNS rebinding
- The pytoch loading model only imports some layer weights, that is, it skips the method of specifying the network layer
- Parameter and buffer in pytoch model
- torch. nn. functional. Interpolate function
- Specify the graphics card during pytorch training
- [paper notes] Dr TANet: dynamic receptive temporary attention network for street scene change detection
- [MQ] achieve mq-08- configuration optimization from scratch fluent
- New signs are taking place in the Internet industry, and a new transformation has begun
- ACL 2022 | visual language pre training for multimodal attribute level emotion analysis
- Cvpr2022 ｜ latest progress in small sample behavior recognition strm framework, spatio-temporal relationship modeling is still the top priority
- Hallucinations in large models
- Is it safe to open an account online? Which of the top ten securities companies are state-owned enterprises?
- [encapsulation tips] encapsulation of list processing function
- Start with Google sea entrepreneurship accelerator - recruitment and start
- Hard core preview in May! Lecture tomorrow night: virtio virtualization technology trend and DPU practice | issue 16
- Druid source code reading 1 - get connection and release connection
- Graduation summary of actual combat training camp
- Public offering "imported products" temporarily hit the reef? The first foreign-funded public offering BlackRock fund has a lot of bad thoughts or a lot of things. It is acclimatized and the performance of the two products is poor
- Introduction and installation of selenium module, use of coding platform, use of XPath, use of selenium to crawl JD product information, and introduction and installation of sketch framework