【问题标题】:Issues with some words in google speech谷歌语音中一些单词的问题
【发布时间】:2018-10-08 20:03:08
【问题描述】:

我对 google 语音有点问题。

我在 FLAC 中有一个音频文件,但是当通过谷歌语音发送该音频时,响应会遗漏一些单词,例如是、不、好的。

有人发生同样的事情。

我正在使用 PHP 7.1 和 Beta API 版本:

这是我的代码:

$encoding = RecognitionConfig\AudioEncoding::FLAC;

$languageCode = 'en-US';

        $config = new RecognitionConfig();

        $speechContext = new SpeechContext(['phrases'=>array('yes', 'no','ok', ' okay')]);


        $config->setEncoding($encoding);
        $config->setEnableAutomaticPunctuation(true);
        $config->setEnableSpeakerDiarization(true);
        $config->setEnableSpeakerDiarization(3);
        $config->setSpeechContexts(array($speechContext));

        $config->setEnableWordTimeOffsets(true);
        $config->setLanguageCode($languageCode);
        $uri = $object->gcsUri();
        $audio = new RecognitionAudio();
        $audio->setUri($uri);
        $operationResponse = $speechClient->longRunningRecognize($config, $audio);

谢谢

【问题讨论】:

    标签: google-cloud-platform google-speech-api


    【解决方案1】:

    要重现此错误,需要一份相关音频文件的副本。我们鼓励您在Public Issue Tracker 中提交此音频文件,并附上您的问题描述。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多