thepylot / TARS

TARS from Interstellar
54 stars 22 forks source link

Error while taking input #4

Open AdityaNerpagar opened 4 years ago

AdityaNerpagar commented 4 years ago

First i got this error =>

File ".\voice_input.py", line 26, in speak speech.save('command.mp3') File "C:\ProgramData\Miniconda3\lib\site-packages\gtts\tts.py", line 248, in save with open(str(savefile), 'wb') as f: PermissionError: [Errno 13] Permission denied: `'command.mp3

Then i fixed it by doing os.remove()

but after doing it i got another error =>

Traceback (most recent call last): File "C:\Users\Aditya\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 183, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "C:\Users\Aditya\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 109, in _get_module_details import(pkg_name) File "C:\Users\Aditya\tars\TARS\tars2.py", line 128, in talk('TARS is ready!') File "C:\Users\Aditya\tars\TARS\tars2.py", line 25, in talk os.remove("audio.mp3") PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'audio.mp3'

how and from where do i close this file.

privacyrespected commented 3 years ago

There is a possibility another audio.mp3 in your directory is causing the problem.

Try replacing the function talk()' with a pyttsx3 function import pyttsx3 def speak(audio): engine = pyttsx3.init() engine.setProperty("rate", 215) print("TARS " + audio) engine.say(audio) engine.runAndWait()

this function can replace gtts and is more stables`

AdityaNerpagar commented 3 years ago

Thanks for the help!!

On Thu, Jan 14, 2021 at 10:10 AM nuggetcatsoftware notifications@github.com wrote:

There is a possibility another audio.mp3 in your directory is causing the problem.

Try replacing the function talk()' with a pyttsx3 function import pyttsx3 def speak(audio): engine = pyttsx3.init() engine.setProperty("rate", 215) print("TARS " + audio) engine.say(audio) engine.runAndWait()

this function can replace gtts and is more stables`

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/raszidzie/TARS/issues/4#issuecomment-759920929, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANLPC4F3WOWFU7DKFDTFA2LSZZYU7ANCNFSM4O745KBQ .