MCPcopy Create free account
hub / github.com/VITA-MLLM/VITA-Audio / has_enough_data

Method has_enough_data

web/queue.py:72–83  ·  view source on GitHub ↗

Check if the buffer contains enough data to fulfill a request of a specified length. Parameters: - length (int): The number of elements required. Returns: - bool: True if the buffer contains enough data, False otherwise.

(self, length)

Source from the content-addressed store, hash-verified

70 self.buffer = np.array([], dtype=np.float32)
71
72 def has_enough_data(self, length):
73 """
74 Check if the buffer contains enough data to fulfill a request of a specified length.
75
76 Parameters:
77 - length (int): The number of elements required.
78
79 Returns:
80 - bool: True if the buffer contains enough data, False otherwise.
81 """
82 with self.lock:
83 return len(self.buffer) >= length
84
85
86class ThreadSafeQueue:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected