I am trying to create a voice assistant program using Python and want my program to play music in the background and wishme at the same time. But when I'm trying to do so, the program first executes the playsound.playsound()
and then executes the wishme command. What should I do?
if __name__ == '__main__':
playsound.playsound('C:\\Users\\socia\\Downloads\\jack_sparrow_bgm.mp3')
wishMe()
while True:
query = takeCommand().lower()
if 'wikipedia' in query:
speak('Searching Wikipedia...')
query = query.replace("wikipedia", "").replace("on", "").replace("search", "")
results = wikipedia.summary(query, sentences=2)
speak('Here is your result SIR.')
print(results)
speak(results)