Ad

Accepting Sound Input All The Time In Raspberry Pi With Python

I'm trying to implement a google assistant like chatbot which can be activated by a voice command or which can directly perform an action when a particular voice input is given without any other interactions. I tried running the code in background, but it closes as soon as the terminal is closed. I want to run the code as soon as the pi boots up and such that it takes input all the time without being affected by any other scripts running parallely. Thank you. Any solution will be appreciated.

Ad

Answer

I believe this more fits the superuser section of stack exchange. Anyways,

To make it run in the background, you would need to make your file executable by running cmod +x /path/to/script then after that you would execute it by nohup /path/to/test.py &.

To make it run on startup you should look at this article on making it run on startup on a Raspberry Pi

Ad
source: stackoverflow.com
Ad