Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Need help in converting the results into audio output #62

Open
Manoj-Bhat97 opened this issue Jan 30, 2020 · 2 comments
Open

Need help in converting the results into audio output #62

Manoj-Bhat97 opened this issue Jan 30, 2020 · 2 comments

Comments

@Manoj-Bhat97
Copy link

Hello @PINTO0309, this is not really an issue, your code works fine for me. I am running SingleStickSSDwithRealSense_OpenVINO_NCS2.py. And I want to convert the detected results and distance into audio output using gTTS for every class_id that has been detected.
However, I have tried inserting the below code at line 104:

description = '{} is ahead in {} meteres away, proceed with caution'.format(class_id, round(meters,2))`
tts = gTTS(description, lang='en')
tts.save('tts.mp3')
tts = AudioSegment.from_mp3("tts.mp3")
subprocess.call(["ffplay", "-nodisp", "-autoexit", "tts.mp3"])

i.e., after
label_text = LABELS[int(class_id)] + " (" + str(percentage) + "%)"+ " {:.2f}".format(meters) + " meters away"
only to be encountered with
TabError: inconsistent use of tabs and spaces in indentation
Kindly help me with it. I am very new to coding.
Thanks in advance.

@PINTO0309
Copy link
Owner

Just replace all indents with spaces. Do not use "TAB".
inconsistent use of tabs and spaces in indentation

@Manoj-Bhat97
Copy link
Author

Yes thank you @PINTO0309

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

No branches or pull requests

2 participants