nodejs-speech
nodejs-speech copied to clipboard
Config for MP3 & "Phone call (Enhanced)" mode ?
Hello,
I'm trying to reproduce the following GUI settings :

I've done this so far :
import { SpeechClient } from '@google-cloud/speech';
(async () => {
const client = new SpeechClient();
await client.recognize({
config: {
sampleRateHertz: 48000,
audioChannelCount: 1,
enableSeparateRecognitionPerChannel: false,
languageCode: 'fr-FR',
useEnhanced: true
}
})
})().catch(console.error);
But, I don't know which config.encoding value matches MP3 :
enum AudioEncoding {
ENCODING_UNSPECIFIED = 0,
LINEAR16 = 1,
FLAC = 2,
MULAW = 3,
AMR = 4,
AMR_WB = 5,
OGG_OPUS = 6,
SPEEX_WITH_HEADER_BYTE = 7,
WEBM_OPUS = 9
}
I can't figure out how to set config.model to match Phone call (Enhanced) either :
interface IRecognitionConfig {
model?: (string|null);
}
Thanks