Beispiel #1
0
def test_tesponse():
    resp = Response(Id="_")

    resp.AddVoice("local_voice")
    resp.AddVoiceTTS("tts_voice")
    resp.AddVoiceWeb("http://web_voice")
    resp.AddAnimation("walk")
    resp.AddFace("smile")
    avreq = resp.AnimatedVoiceRequest
    assert avreq.AnimatedVoices[0].Voices[0].Name == "local_voice"
    assert avreq.AnimatedVoices[0].Voices[0].Source == VoiceSource.Local
    assert avreq.AnimatedVoices[0].Voices[1].Text == "tts_voice"
    assert avreq.AnimatedVoices[0].Voices[1].Source == VoiceSource.TTS
    assert avreq.AnimatedVoices[0].Voices[2].Url == "http://web_voice"
    assert avreq.AnimatedVoices[0].Voices[2].Source == VoiceSource.Web
    assert avreq.AnimatedVoices[0].Animations["Base Layer"][0].Name == "walk"
    assert avreq.AnimatedVoices[0].Faces[0].Name == "smile"
Beispiel #2
0
 async def get_prompt_async(self, request: Request, state: State) -> Response:
     resp = Response(Id="_" if request is None else request.Id)
     resp.AddVoiceTTS("非同期サーバーからのプロンプトです。何か喋ってください。")
     return resp
Beispiel #3
0
 def pre_process(self, request: Request, state: State) -> Response:
     return Response(Id=request.Id)
Beispiel #4
0
 async def process_async(self, request: Request, state: State) -> Response:
     return Response(Id=request.Id)
Beispiel #5
0
 async def process_async(self, request: Request, state: State) -> Response:
     resp = Response(Id=request.Id)
     resp.AddVoiceTTS(request.Text)
     return resp