gpt4 book ai didi

java - Google Cloud 语音 API 中转录的文件大小

转载 作者:行者123 更新时间:2023-11-30 06:18:28 25 4
gpt4 key购买 nike

Google Cloud Speech API 希望您使用 sync recognition mode对于运行时间不到一分钟并使用 async recognition mode 的音频文件如果音频文件超过一分钟。

如何分析使用哪个接口(interface)来获取文字记录,我们应该根据音频文件大小来分析吗?或者如何找到音频转录过程中的总时间或如何处理这种情况?

最佳答案

音频文件大小与确定音频持续时间无关,因为音频文件由许多音频样本组成(样本总数取决于每秒采集的音频样本数,以赫兹为单位),每个样本都具有给定的大小(对样本进行编码需要多少位)。

您可能会找到sox实用程序及其 soxi 程序在此处可用于确定音频文件的持续时间。 soxi 将解析音频文件的 header 以提供该信息。这是一个 WAV 文件的示例:

$ soxi audiofile.wav

Input File : 'audiofile.wav'
Channels : 2
Sample Rate : 48000
Precision : 16-bit
Duration : 00:00:59.76 = 2868480 samples ~ 4482 CDDA sectors
File Size : 11.5M
Bit Rate : 1.54M
Sample Encoding: 16-bit Signed Integer PCM

希望这有帮助!

关于java - Google Cloud 语音 API 中转录的文件大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48699504/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com