Convert audio tensor to numpy before PCM conversion
All checks were successful
Build and Push Docker Image / build (push) Successful in 2m11s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-08 19:11:30 -04:00
parent 9e907b7573
commit f2513c12a9

View File

@@ -127,7 +127,8 @@ class KokoroEventHandler(AsyncEventHandler):
if audio is None:
continue
# float32 [-1, 1] → int16
pcm = (np.clip(audio, -1.0, 1.0) * 32767).astype(np.int16)
audio_np = audio.cpu().numpy() if hasattr(audio, 'cpu') else audio
pcm = (np.clip(audio_np, -1.0, 1.0) * 32767).astype(np.int16)
asyncio.run_coroutine_threadsafe(
chunk_queue.put(pcm.tobytes()), loop
)