Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform 谷歌语音到文本的可能采样率?_Google Cloud Platform_Google Cloud Speech - Fatal编程技术网

Google cloud platform 谷歌语音到文本的可能采样率?

Google cloud platform 谷歌语音到文本的可能采样率?,google-cloud-platform,google-cloud-speech,Google Cloud Platform,Google Cloud Speech,我正在使用GCS文档中提供的功能,该功能允许我在云存储中转录文本: def transcribe_gcs(gcs_uri): """Asynchronously transcribes the audio file specified by the gcs_uri.""" from google.cloud import speech from google.cloud.speech import enums from google.cloud.speech im

我正在使用GCS文档中提供的功能,该功能允许我在云存储中转录文本:

def transcribe_gcs(gcs_uri):
    """Asynchronously transcribes the audio file specified by the gcs_uri."""
    from google.cloud import speech
    from google.cloud.speech import enums
    from google.cloud.speech import types
    client = speech.SpeechClient()

    audio = types.RecognitionAudio(uri=gcs_uri)
    config = types.RecognitionConfig(
        encoding=enums.RecognitionConfig.AudioEncoding.FLAC,
        sample_rate_hertz=48000,
        language_code='en-US')

    operation = client.long_running_recognize(config, audio)

    print('Waiting for operation to complete...')
    response = operation.result(timeout=2000)

    # Print the first alternative of all the consecutive results.
    for result in response.results:
        print('Transcript: {}'.format(result.alternatives[0].transcript))
        print('Confidence: {}'.format(result.alternatives[0].confidence))
    return ' '.join(result.alternatives[0].transcript for result in response.results)
默认情况下,
sample\u rate\u hertz
设置为16000。我把它改成了48000,但我一直很难把它调高,比如64k或96k。是48k是采样率的上限吗

如中所述,48000 Hz确实是此API支持的上限

系统支持8000 Hz和48000 Hz之间的采样率 语音API

因此,为了使用更高的采样率,您必须对音频文件重新采样

我还想向您介绍一下云语音API支持的功能的基本信息