MediaInput not accepting 8Khz audio

Hello, I am trying to run a convo script like so:

sw1a-2aa

#me
MEDIA ./audiofiles/sw1a-2aa.wav

#bot
INTENT PostcodeIntent

This is my Botium.json:

{

  "botium": {

    "Capabilities": {

      "PROJECTNAME": "Botium Project Lex",

      "CONTAINERMODE": "lex",

      "LEX_VERSION": "V2",

      "LEX_REGION": "eu-west-2",

      "LEX_ACCESS_KEY_ID": "[REDACTED]",

      "LEX_SECRET_ACCESS_KEY": "[REDACTED]",

      "LEX_PROJECT_NAME": "[REDACTED]",

      "LEX_PROJECT_ALIAS": "[REDACTED]",

      "LEX_LOCALE": "en_GB",

      "LEX_ACCEPT": "audio/pcm",

      "USER_INPUTS": [

        {

          "ref": "MEDIA",

          "src": "MediaInput",

          "args": {

            "downloadMedia": true

          }

        }

      ]

    }

  }

}

The problem seems to be that the audio file has an 8Khz project rate - I tried the same test with a 16khz project rate WAV file and the test worked.

I must use 8Khz files for my test since certain metrics are only offered by Lex when using this file quality.

Oddly, the error when I try to run the test is:

     Error: sw1a-2aa/Line 6: assertion error - Line 6: Expected intent "PostcodeIntent" but found FallbackIntent
########################################
ASSERTION FAILED in IntentAsserter - Expected: "PostcodeIntent"  - Actual: "FallbackIntent"
------------ TRANSCRIPT ----------------------------
#me:   MEDIA(./audiofiles/sw1a-2aa.wav | audio/wave)
#bot:

Although I’m not actually seeing any lambda logs at all in for this request!

How can I make Botium accept 8KHz files?

Thanks.

Try to set the LEX_CONTENTTYPE_AUDIO capability in your botium.json.

Please see Lex docs for supported audio content types.

Maybe this one works:

audio/lpcm; rate=8000; channels=1

Thanks, this was the issue. The setting that worked for me was:
“LEX_CONTENTTYPE_AUDIO”: “audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false”,

1 Like