Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pyaudio
#8
if text ever reaches the condition where it is equal to "",
your code will loop forever between lines 44 - 46, never going back to line 42.
if you add a break statement after line 46, flow will go back to line 42 and continue outer loop,
it will then exit the first loop because text will = "", the process will then terminate.

while "how are you" in text:
    speak("I am fine ")
    while True:
     if "" in text:
        get_audio()
        break
This code seems convoluted. I'm on the way out the door, but if no one else does so before I get back, I'll take a closer look.
Reply


Messages In This Thread
Pyaudio - by Souls99 - Sep-30-2020, 10:42 AM
RE: Pyaudio - by Larz60+ - Sep-30-2020, 12:27 PM
RE: Pyaudio - by Souls99 - Sep-30-2020, 02:46 PM
RE: Pyaudio - by Larz60+ - Sep-30-2020, 05:48 PM
RE: Pyaudio - by Souls99 - Sep-30-2020, 10:16 PM
RE: Pyaudio - by Larz60+ - Oct-01-2020, 01:51 AM
RE: Pyaudio - by Souls99 - Oct-05-2020, 10:28 AM
RE: Pyaudio - by Larz60+ - Oct-05-2020, 04:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pyaudio seems to randomly halt input. elpidiovaldez5 2 419 Jan-22-2024, 09:07 AM
Last Post: elpidiovaldez5
  Not getting response from pyaudio OceansBlue 1 2,678 Jul-03-2021, 06:22 AM
Last Post: OceansBlue
  help with PyAudio Leo12143 1 1,983 Jan-18-2021, 09:56 AM
Last Post: DT2000
  pyAudio playing variable Talking2442 3 3,054 Dec-01-2020, 06:20 PM
Last Post: Talking2442
  PyAudio [Errorno -9999] Unanticipated Host Error iMuny 5 5,756 Sep-21-2020, 06:58 PM
Last Post: jefsummers
  PyAudio Buffer Data Calculation MclarenF1 0 2,161 Aug-21-2020, 10:55 AM
Last Post: MclarenF1
  PyAudio throwing Input overflowed anthares 3 4,838 Jun-14-2020, 03:37 PM
Last Post: anthares
  Using pyaudio to stop recording under certain sound threshold Twanski94 2 6,516 Jun-13-2020, 11:35 AM
Last Post: Twanski94
  update imhow in callback from pyaudio markB 0 2,371 May-28-2020, 06:01 PM
Last Post: markB
  When piping a FFMPEG stream to PyAudio, I get a "click" on every loop klehman 0 4,883 Dec-15-2019, 04:22 AM
Last Post: klehman

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020