Convert audio tensor to numpy before PCM conversion
All checks were successful
Build and Push Docker Image / build (push) Successful in 2m11s
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:
@@ -127,7 +127,8 @@ class KokoroEventHandler(AsyncEventHandler):
|
|||||||
if audio is None:
|
if audio is None:
|
||||||
continue
|
continue
|
||||||
# float32 [-1, 1] → int16
|
# 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(
|
asyncio.run_coroutine_threadsafe(
|
||||||
chunk_queue.put(pcm.tobytes()), loop
|
chunk_queue.put(pcm.tobytes()), loop
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user