this.connect error from microsoft pronunciation assessment sdk

58 views Asked by At

I am using Azure's pronunciation assessment sdk for a service I am developing. I am currently saving audio files in lambda's tmp folder for ephemeral access. My code works fine on my local environment (microsoft can access my local tmp folder just fine), but I receive this error when I deploy it to the dev environment. This is my code and error:

let audioConfig
try {
  if (fs.existsSync(filePath)) {
    console.log('File Path Found for audio config: ', filePath)
    fs.readdir('/tmp', (err, files) => {
      console.log('TMP DIR FILES:', files)
    })
    audioConfig = sdk.AudioConfig.fromWavFileInput(fs.readFileSync(filePath))

    console.log('audioConfig: ', audioConfig)
  } else {
    return reject(new Error('File not found: ' + filePath))
  }
} catch (err) {
  return reject(new Error('Error reading file: ' + err))
}

{ "message": "Recognition not successful. Reason: Error Code: 4, Error Details: Unable to contact server. StatusCode: 1006, undefined Reason: this.connect is not a function" }

0

There are 0 answers