【问题标题】:File size for transcription in Google Cloud speech APIGoogle Cloud Speech API 中转录的文件大小
【发布时间】:2018-02-09 05:49:55
【问题描述】:
【问题讨论】:
标签:
java
audio
google-cloud-platform
speech-recognition
google-speech-api
【解决方案1】:
音频文件大小与确定音频持续时间无关,因为音频文件由多个音频样本组成(样本总数取决于每秒采集的音频样本数,以赫兹为单位),这些样本中的每一个都具有给定的大小(对样本进行编码需要多少位)。
您可能会发现sox 实用程序及其soxi 程序可用于确定音频文件的持续时间。 soxi 将解析您的音频文件的标题以提供该信息。这是一个带有 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
希望这有帮助!