Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMError... i think it is a permission issue? #2

Open
jason79 opened this issue Apr 29, 2017 · 1 comment
Open

COMError... i think it is a permission issue? #2

jason79 opened this issue Apr 29, 2017 · 1 comment

Comments

@jason79
Copy link

jason79 commented Apr 29, 2017

import tts.sapi

directory= 'D:\Google Drive\python\'
voice = tts.sapi.Sapi()
voice.set_voice("IVONA 2 Joey")
voice.create_recording(directory+'hello.wav', "Hello")

I can write to this directory with other python scripts, but not sure why I can't do it here.

Traceback (most recent call last):
File "D:\Google drive\python\test3.py", line 6, in
voice.create_recording(directory+'hello.wav', "Hello")
File "C:\Python27\lib\site-packages\tts\sapi.py", line 104, in create_recording
stream = self._create_stream(filename)
File "C:\Python27\lib\site-packages\tts\sapi.py", line 97, in _create_stream
stream.Open(filename, SpeechLib.SSFMCreateForWrite)
COMError: (-2147287038, None, (None, None, None, 0, None))

@DeepHorizons
Copy link
Owner

I think its because you are using backslashes. Your directory string should look like directory= 'D:/Google Drive/python/'. This is because Python uses backslashes in strings to specify special characters (like \n, \r, ect.) Forward slashes work just fine on windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants