tts_request=backend_pb2.TTSRequest(text="VoxCPM is an innovative end-to-end TTS model from ModelBest. This is a streaming test.",dst="test_stream.wav")
chunks_received=0
total_audio_bytes=0
forreplyinstub.TTSStream(tts_request):
# Verify that we receive audio chunks
ifreply.audio:
chunks_received+=1
total_audio_bytes+=len(reply.audio)
self.assertGreater(len(reply.audio),0,"Audio chunk should not be empty")
# Verify that we received multiple chunks
self.assertGreater(chunks_received,0,"Should receive at least one audio chunk")
self.assertGreater(total_audio_bytes,0,"Total audio bytes should be greater than 0")
print(f"Received {chunks_received} chunks with {total_audio_bytes} total bytes")