Alibabacloud.com offers a wide variety of articles about goanimate voices text to speech, easily find your goanimate voices text to speech information here online.
:/Program Files/Microsoft Speech SDK 5.1/Lib/i386"
The following is the header file speechclass. h.
#ifndef SPEECHCLASS_H#define SPEECHCLASS_H#undef UNICODE#include
The following is the source file speechclass. cpp.
# Include "speechclass. H "# define Eng 0x00 # define CHN 0x01 // constructor speech: Speech () {hR = s_ OK; wchar * W1 = l "HKEY_LOCAL_MACHINE
How does Python implement text-to-speech conversion,
Preparation
The Python version I tested is 2.7.10. If your Python version is Python3.5, It is not suitable here.
Use the Speech API
Principle
Our idea is to use Microsoft's Voice interface, so we must call related interfaces. Therefore, we need to install pywin32 to help us complete this underlying interaction.
Get readyI tested a python version of 2.7.10, and if your version is Python3.5, it's not a good place to be.Using the speech APIPrincipleOur idea is to use Microsoft's voice interface, so we're definitely going to call the relevant interface. So we need to install Pywin32 to help us complete this bottom-up interaction.Sample code
123
importwin32com.clientspeaker =win32com.client.Dispatch("SAPI.SpVoice")speaker.Speak("Hello, it wor
. Volume = print "Speech Volume =", TTS. Volume # Get a list of all the available voices print "List of voices =", TTS. Getvoicenames () # explicitly set a voice TTS. Setvoicebyname (' msmary ') print "Voice is set ot msmary" Print # announce the date and time, does a good job timestr = "the Date and time is "+ time.asCTime () Print Timestr TTS. Speak (timestr) P
Python converts text into speech,
This example describes how python converts Text to Speech. Share it with you for your reference. The specific implementation method is as follows:
# Text To Speech using SAPI (Windows) and Python
Free text readers.ListenerCompositionFiles, jobs, PowerPoint presentations, e-mails, RSS seeds, blogs, books... When you relax, commuting or exercise.Massive online learning, learning a new language, checking documents, multitasking and entertainment.Yakitome!Speak English, Spanish, French, German... with male and female voices, use the world's best text
iOS provides a class Avspeechsynthesizer for text-to-speech functions, i.e., reading textDirectly on the code:Avspeechsynthesizer *synthesizer =[[Avspeechsynthesizer alloc] init]; Nsarray*speechstrings = @[@"Hello AV Foundation. How is it?", @"I'm fine, thanks!", @"is excited about the book ?", @"Yes, I like this book
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.