【问题标题】:Its possible to play audio stream(PCM stream 8000) from vxml or ccxml (Voximal)可以从 vxml 或 ccxml(Voximal)播放音频流(PCM 流 8000)
【发布时间】:2017-09-21 09:38:53
【问题描述】:

希望你做得很好。 我们一直在 Ubuntu(16.04.2 LTS)上使用带有星号 13 的 Voximal(最新)。

我正在尝试调用我的 java web 服务,它返回 PCM 8000 流,我们正在使用 Amazon polly 生成这个流,然后我想通过电话严格使用 vxml 向用户播放相同的流。

首先我想知道是否可以使用 VXML2.1 或 CCXML 播放 PCM 流,我搜索了很多直到现在没有成功。

这是我的 vxml 代码,只是一个疯狂的尝试 :)

 <?xml version="1.0" encoding="UTF-8"?>
   <vxml version="2.1">
     <var name="serviceVS" expr="'http://localhost:57144/polly/v1'"/>
      <form>
<filled>
 <data name="url" srcexpr="serviceVS" method="post" namelist="file" 
  enctype="multipart/form-data"/>
  <assign name="urlToPlay" expr="url.url"/>

<log>
 urlToPlay =>
 <value expr="urlToPlay"/>
 </log>
  <audio expr ="urlToPlay"/>
 </filled>
  </form>
  </vxml>

下面是我的java代码

@RequestMapping(value="/polly/v1", method = {RequestMethod.POST,RequestMethod.GET})
public ResponseEntity<InputStreamResource> pollyEndPoint(@RequestParam("voiceId") String voiceId,
        @RequestParam("text")String text,@RequestParam("outputFormat") String outputFormat){
    InputStream speechStream= null;
    InputStreamResource inputStreamResource=null;
    HttpHeaders headers=null;
    try{
        speechStream=quikWitService.getPollyTextToSpeech(voiceId,text,outputFormat);
        inputStreamResource= new InputStreamResource(speechStream);
        headers = new HttpHeaders();
        headers.add("Content-Type",QuikWitUtils.getAudioFormatContentType(outputFormat));

    }
    catch(Exception e){
        logger.error(e);
        logger.debug(e.getStackTrace());
    }
    return new ResponseEntity<>(inputStreamResource,headers, HttpStatus.OK);

}

如果有人可以向我指出任何文章或任何更多信息,我将不胜感激。

谢谢

【问题讨论】:

    标签: java vxml amazon-polly ccxml


    【解决方案1】:

    Polly 与 Voximal 集成(您只需在 TTS/prompt 部分设置正确的配置)。 Voximal 使用命令行“aws”生成本地音频内容,您可以访问 Amazon TextToSpeech 的全部功能,但应使用另一种方法减少响应时间(约 1 秒延迟,但 Voximal 使用缓存可以掩盖这种影响)。我们将在下一个 Voximal 版本中改进 Polly 集成。

    另一种方法是使用我们的 TTS/HTTP API 创建您自己的 Polly 集成: https://wiki.voximal.com/doku.php?id=installation_guide:tts_http:start

    对于每个部分,如果文本内容不在缓存中,Voximal 将生成 HTTP 请求。

    【讨论】:

      猜你喜欢
      • 2010-11-08
      • 1970-01-01
      • 1970-01-01
      • 2018-07-05
      • 2015-11-06
      • 1970-01-01
      • 2013-09-18
      • 2023-03-23
      • 2017-05-08
      相关资源
      最近更新 更多