nodejs-speech icon indicating copy to clipboard operation
nodejs-speech copied to clipboard

Config for MP3 & "Phone call (Enhanced)" mode ?

Open tianalemesle opened this issue 3 years ago • 0 comments

Hello,

I'm trying to reproduce the following GUI settings :

Screenshot from 2022-07-13 12-09-30 Screenshot from 2022-07-13 12-09-07

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

tianalemesle avatar Jul 13 '22 10:07 tianalemesle