Plyer TTS not working on Windows
I cannot get plyer.tts to work on Windows.
>>> from plyer import tts >>> tts.speak("Hello world!") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\plyer\facades\tts.py", line 30, in speak self._speak(message=message) File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\plyer\facades\tts.py", line 35, in _speak raise NotImplementedError() NotImplementedError
The documentation states that tts works on Windows and I remember getting it to work in the past on a different PC.
What could be the problem?
See also questions close to this topic
What are the speed benchmarks in Watson-NLU?
I am trying to process tweets stored in a text file. My code reads the tweets(one by one), processes them and then save the results of Watson in a csv file. The speed is around 28 tweets per minute only. Is data file handling causing this delay?
while 1: where = file.tell() line = file.readline() if not line: print "no line found, waiting for a 1 seconds" time.sleep(1) file.seek(where) else: if (re.search('[a-zA-Z]', line)): print "-----------------------------" print "the line is: " print line print "-----------------------------" response = natural_language_understanding.analyze( text=line, features=Features( entities=EntitiesOptions( emotion=True, sentiment=True, limit=2), keywords=KeywordsOptions( emotion=True, sentiment=True, limit=2)), language='en' ) response["tweet"] = line print(json.dumps(response, indent=2)) with open('#DDvKXIP.csv', 'a') as csv_file: writer = csv.writer(csv_file) for key, value in response.items(): writer.writerow([key, value]) else: print "--------------------------------" print "found a line without any alphabet in it, hence not considering." print line print "--------------------------------"
Looping through DF column to remove rows that have spanish text
Here is the code I'm using to filter out any spanish text:
from langdetect import detect #detects what language is written from tqdm import tqdm #timing package # 'summary_processed' is a list of sentence strings that had general text preprocessing done (lemmetization, regex removal, lowercasing, etc) summary_processed_en = [i for i in tqdm(summary_processed) if detect(i) == 'en']
Now, this isn't a typical conditional statement so I can't do my normal
df[df == "X"]format.
I'm not entire sure how to approach this. Any help would be much appreciated.
TextBlob: Ranges to define sentiment groups
I'm working on a research project that uses TextBlob for sentiment analysis. On their website, the developers of TextBlob explain that the sentiment polarity ranges from -1.0 to +1.0, where -1.0 denotes complete negativity while +1.0 should represent complete positivity.
What are common ways, or how did the developers intend, that the numbers are converted to the classification: positive, neutral, negative?
In other words, can we assume that the following classification exists:
Sentiment: Score: Positive +1.0 > x > 0 Neutral x = 0 (precisely) Negative 0 < x < -1.0
Is there perhaps documentation about this? I haven't been able to find detailed documents yet.
How can I force TTS to pronounce chinese characters correctly?
When I feed the Chinese character '得' into TTS, it doesn't pronounce it 'děi', but 'de'. I know both are correct, but is there a way I can force it to use the former instead of the latter? In Japanese I have the same problem, but I can force it by swapping the Kanji with Romaji. However, it seems like TTS doesn't support Pinyin, so that's a dead end. Maybe I can find a different character that sounds like 'děi', but that's not a solution. Maybe someone in the SO community already has a hack for this, I didn't find any on my web crawl.
How to turn on pages automatically with Speak Screen in ePub Reader
I have developed iOS reader with UIWebview. I am able to use speak screen with my ePub reader. It speaks the text content. Problem is Speak screen is not automatically turn on next page for me.
Saving Text to Speech Python
I am trying save the results of text to speech to a file on windows. I successfully gotten it to speak (using
speak.Speak). However, no such luck with saving files.
The problem is
AudioOutputStreamisn't being found, despite it being listed in the Microsoft docs.
Version information: Windows 10, Python 3.6
Traceback (most recent call last): File "...\dd.py", line 87, in <module> speak.AudioOutputStream = filestream File "...\win32com\client\dynamic.py", line 565, in __setattr__ self._oleobj_.Invoke(entry.dispid, 0, invoke_type, 0, value) pywintypes.com_error: (-2147352573, 'Member not found.', None, None)
from win32com.client import Dispatch import win32api speak = Dispatch("SAPI.SpVoice") filestream = Dispatch("SAPI.SpFileStream") filestream.open("out.wav", 3, False) for k in speak.GetAudioOutputs(): print(k.GetDescription()) speak.AudioOutputStream = filestream speak.Speak("test") filestream.close()