问题
There are a lot of audio formats (e.g., mp3, m4a), sources (e.g., dictation, commands, phone calls, meetings) and devices (e.g., phones, PCs, IoT devices). Which ones work best with Cloud Speech API?
回答1:
Which ones work best with Cloud Speech API?
Supported ones shall work best:
- LINEAR16 Uncompressed 16-bit signed little-endian samples. This is the only encoding that may be used by speech.asyncrecognize.
- FLAC This is the recommended encoding for speech.syncrecognize and StreamingRecognize because it uses lossless compression; therefore recognition accuracy is not compromised by a lossy codec.
- MULAW 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
- AMR Adaptive Multi-Rate Narrowband codec. sampleRate must be 8000 Hz.
- AMR_WB Adaptive Multi-Rate Wideband codec. sampleRate must be 16000 Hz.
https://cloud.google.com/speech/reference/rest/v1beta1/RecognitionConfig#AudioEncoding
来源:https://stackoverflow.com/questions/38485515/what-types-of-audio-are-supported-by-cloud-speech-api