0

I am using PyAudio in a Python script on a Raspberry Pi B. It (successfully) runs a recording loop every 10 seconds, listening for a keyword. But there is a substantial pause in between each loop which I am trying to eliminate. I have narrowed it down to where the script instantiates the stream object (see snippet below). This particular operation takes 10-11 seconds to execute, whereas everything else is instantaneous. Nothing else is running on the Pi.

I dont know if this is natural, or whether some other underlying issue (eg. alsa config?) might be the cause. Should this take a full 10 seconds to execute?

stream = p.open(format=FORMAT,
                channels=CHANNELS,
                rate=RATE,
                input=True,
                frames_per_buffer=CHUNK)
Lee Melbourne
  • 407
  • 5
  • 20

1 Answers1

0

To close off this thread....seems the problem was my webcam (Microsoft Lifecam). I switched to a Logitech C170 and the 10 second delay in each listening loop went away.

Lee Melbourne
  • 407
  • 5
  • 20