29 lines
657 B
Python
29 lines
657 B
Python
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}") |