async def _idle_monitor_handler(self):
        """This tasks monitors activity in the pipeline. If no frames are
        received (heartbeats don't count) the pipeline is considered idle.

        """
        running = True
        last_frame_time = 0
        while running:
            try:
                frame = await asyncio.wait_for(
                    self._idle_queue.get(), timeout=self._idle_timeout_secs
                )

                if isinstance(frame, StartFrame) or isinstance(frame, self._idle_timeout_frames):
                    # If we find a StartFrame or one of the frames that prevents a
                    # time out we update the time.
                    last_frame_time = time.time()
                else:
                    # If we find any other frame we check if the pipeline is
                    # idle by checking the last time we received one of the
                    # valid frames.
                    diff_time = time.time() - last_frame_time
                    if diff_time >= self._idle_timeout_secs:
                        running = await self._idle_timeout_detected()

                self._idle_queue.task_done()
            except asyncio.TimeoutError:
                running = await self._idle_timeout_detected()
This tasks monitors activity in the pipeline. If no frames are
        received (heartbeats don't count) the pipeline is considered idle.

        
src/pipecat/pipeline/task.py