feat: establish voice assistant V1 baseline
This commit is contained in:
29
tests/test_voxcpm_tts_integration.py
Normal file
29
tests/test_voxcpm_tts_integration.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import pytest
|
||||
|
||||
from voice_assistant.tts.voxcpm import VoxCPMTTSAdapter
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_voxcpm_tts_real():
|
||||
tts = VoxCPMTTSAdapter(
|
||||
server="http://127.0.0.1:8000",
|
||||
model="openbmb/VoxCPM2",
|
||||
voice="default",
|
||||
)
|
||||
|
||||
chunks = [
|
||||
chunk
|
||||
async for chunk in tts.synthesize(
|
||||
"Olá Alex, este é um teste do VoxCPM."
|
||||
)
|
||||
]
|
||||
|
||||
assert chunks
|
||||
assert all(isinstance(chunk, bytes) for chunk in chunks)
|
||||
|
||||
total_bytes = sum(len(chunk) for chunk in chunks)
|
||||
|
||||
assert total_bytes > 0
|
||||
|
||||
print(f"Chunks recebidos : {len(chunks)}")
|
||||
print(f"Bytes recebidos : {total_bytes}")
|
||||
Reference in New Issue
Block a user