MCPcopy
hub / github.com/openai/openai-python / add_data

Method add_data

examples/realtime/audio_util.py:73–79  ·  view source on GitHub ↗
(self, data: bytes)

Source from the content-addressed store, hash-verified

71 return self._frame_count
72
73 def add_data(self, data: bytes):
74 with self.lock:
75 # bytes is pcm16 single channel audio data, convert to numpy array
76 np_data = np.frombuffer(data, dtype=np.int16)
77 self.queue.append(np_data)
78 if not self.playing:
79 self.start()
80
81 def start(self):
82 self.playing = True

Callers 1

Calls 2

startMethod · 0.95
appendMethod · 0.45

Tested by

no test coverage detected