def output_stream_callback(self, outdata, frames, time, status):
        """Callback for output stream to get audio data"""
        if status:
            print(status)
        
        try:
            data = self.output_queue.get_nowait()
            data = data.astype(np.float32) / 32767.0
            if len(data) < len(outdata):
                outdata[:len(data)] = data
                outdata[len(data):] = 0
            else:
                outdata[:] = data[:len(outdata)]
        except queue.Empty:
            outdata.fill(0)
Callback for output stream to get audio data
inference_client.py