Watson-Personal-Assistant / AudioClientSampleCodeJava

Apache License 2.0
1 stars 5 forks source link

Audio Client Ignores Prompt Setting In audio_end Message #17

Open ajgbarnes opened 6 years ago

ajgbarnes commented 6 years ago

The audio client today only uses the "prompt" value from the attribute in the "action": "text" message as below:

{
    "speech": "I am not trained for this",
    "voice": "https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize?voice=en-US_LisaVoice&text=I%20am%20not%20trained%20for%20this&watson-token=xc9D......ATB",
    "id": "aa16b1e9-xxxx-xxxx-xxxx-58b7f7df23d7",
    "language": "en-US",
    "audioFormat": "ogg;codecs=vorbis",
    "prompt": true,
    "action": "text"
}

It does NOT however take notice of the value in audio_end:

{
    "action": "audio_end",
    "id": "aa16b1e9-xxxx-xxxx-xxxx-58b7f7df23d7",
    "prompt": true
}

They should arguably always be the same however maybe there is also a bug in the AudioGateway as we are seeing differences in these values.

esilky commented 6 years ago

What if they are not the same? Should the value in the audio_end take priority?

ajgbarnes commented 6 years ago

I think it depends on whether you are playing audio from the URL or via the streamed audio data.

They should always be the same and this value should only ever be returned once but it isn't - so in that situation I think the logic above works? @troyibm