如何在Google行为实现中使用或提供AAC格式的音频

时间:2019-06-12 07:21:50

标签: dialogflow google-home

我正在尝试为我的Google家庭用户播放音频流。带有mp3文件的richresponse可以完美运行。但是当我尝试使用aac编码的文件时,音频将永远不会播放。

Google主页现在不支持AAC音频格式。那么有什么想法为什么不起作用?我们是否需要提供其他mediaType?

是否会因为Google助手不支持AAC格式而发生?但是如果是这样,那么其他流媒体公司会使用哪种格式?

$output = array (           
    "fulfillmentText"  => $Response,            
    "source"  => "My Stream",
    "payload" => array(             
        "google" => array (
                  'expectUserResponse' => false,
                  'richResponse' => 
                          array (
                            'items' => 
                            array (
                              0 => 
                              array (
                                'simpleResponse' => 
                                array (
                                  'textToSpeech' => $Response,
                                ),
                              ),
                              1 => 
                              array (
                                'mediaResponse' => array (
                                    'mediaType' => 'AUDIO',
                                    'mediaObjects' => 
                                    array (
                                      0 => 
                                        array (
                                            'name' => 'Sample stream',
                                            'contentUrl' => 'https://stream.test.com/117/full/64.aac'
                                        )
                                    )
                                )                         
                            )                   
                        )

                )
            )
        )
    );

1 个答案:

答案 0 :(得分:0)

虽然确实是Google Home supports AAC的硬件,但通过Google客户端库don't currently support AAC上的操作获得了媒体响应:

  

用于播放的音频必须位于格式正确的.mp3文件中。生活   不支持流式传输。

相关问题