May-03-2018, 02:42 PM
I'm facing a problem in my application:
I'm developing a kind of robot... (using python, raspberry pi 3, a ttf lcd 3.5 and pygame lib)
So it has:
An interface - A background and some information on the screen. A Voice gtts - Talks and listen to my mic...
And an animation...- That draw a circle in my background while mixer is playing the audio recorded from gtts... making a "talk" effect...
Below is my code.. (I have uploaded my code to my public Google drive folder, so no permission problems) I didn't write the code here, because it is not that so long, but it will be very hard to not make a large text here...
https://drive.google.com/open?id=1BEh0ce...Pe05Sp5WoV
The problem:
I want to call the function: bertaTalkingAnimation(berta.py) inside of talkToMe function (voice.py) it is commented on the code, because everything that the robot will talk it'll need this talk animation developed on bertaTalkingAnimation...
I don't want to call it from my function main (below the KEY_SPACE event handle), because my function main it's not finished yet.. (Just using keyboard keys events to test my robot...)
I'm calling init_voice (to call all the functions to listen and talks back) through a thread, because I don't want to stop my background information every time that robot speak, and that's the problem, because I can't pass (even using args) a surface to draw on...
How can I call bertaTalkingAnimation outside main function and after talkToMe runs?
Thank you so much!
I'm developing a kind of robot... (using python, raspberry pi 3, a ttf lcd 3.5 and pygame lib)
So it has:
An interface - A background and some information on the screen. A Voice gtts - Talks and listen to my mic...
And an animation...- That draw a circle in my background while mixer is playing the audio recorded from gtts... making a "talk" effect...
Below is my code.. (I have uploaded my code to my public Google drive folder, so no permission problems) I didn't write the code here, because it is not that so long, but it will be very hard to not make a large text here...
https://drive.google.com/open?id=1BEh0ce...Pe05Sp5WoV
The problem:
I want to call the function: bertaTalkingAnimation(berta.py) inside of talkToMe function (voice.py) it is commented on the code, because everything that the robot will talk it'll need this talk animation developed on bertaTalkingAnimation...
I don't want to call it from my function main (below the KEY_SPACE event handle), because my function main it's not finished yet.. (Just using keyboard keys events to test my robot...)
I'm calling init_voice (to call all the functions to listen and talks back) through a thread, because I don't want to stop my background information every time that robot speak, and that's the problem, because I can't pass (even using args) a surface to draw on...
How can I call bertaTalkingAnimation outside main function and after talkToMe runs?
Thank you so much!