jovotech/jovo-framework

Returning <audio> tag in message.speech for Web client throws atob error and audio is not played

rmtuckerphx opened this issue · 2 comments

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request
  • Other... Please describe:

Expected Behavior

When returning an audio tag in message.speech or reprompt.speech for the Web client, the browser should play the audio file.

Current Behavior

No audio file is played and the browser returns Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.

I've tried returning just the <audio> tag:

{
  "version": "4.0.0",
  "platform": "web",
  "output": [
    {
      "message": {
        "speech": "<audio src=\"https:/markt-rain-test-public.s3.amazonaws.com/polly-tts/audio/en/Matthew-719e141f5da0a96effa59e6d3221f981.mp3\" />",
        "text": "You can say \"switch to dark mode\" or \"light mode.\""
      },
      "reprompt": {
        "speech": "<audio src=\"https:/markt-rain-test-public.s3.amazonaws.com/polly-tts/audio/en/Matthew-fcc02e9d77bc28f29fae1bc540dc7dc7.mp3\" />",
        "text": "Dark or light mode?"
      },
      "listen": false
    }
  ],
  "context": {
    "request": {},
    "session": {
      "end": true,
      "data": {},
      "id": "73463f04-c8cc-41be-bb5a-b0de97bcb851"
    },
    "user": {
      "data": {}
    }
  }
}

As well as the audio tag wrapped in <speak> tags:

{
  "version": "4.0.0",
  "platform": "web",
  "output": [
    {
      "message": {
        "speech": "<speak><audio src=\"https:/markt-rain-test-public.s3.amazonaws.com/polly-tts/audio/en/Matthew-3dc19ae57f148e925d7b564adf4e37b4.mp3\" /></speak>",
        "text": "Ok, dark mode."
      },
      "listen": false,
      "platforms": {
        "web": {
          "theme": "dark"
        }
      }
    }
  ],
  "context": {
    "request": {},
    "session": {
      "end": true,
      "data": {},
      "id": "6c61b033-9cf1-478f-8250-8274eedfacb1"
    },
    "user": {
      "data": {}
    }
  }
}

Error Log

This is the error I see in the browser Dev tools:

Chrome
image

Firefox
image

Your Environment

@jovotech/cli: 4.1.6

Jovo packages of the current project (updates available):

  • @jovotech/cli-command-build: 4.1.6
  • @jovotech/cli-command-deploy: 4.1.6
  • @jovotech/cli-command-get: 4.1.6
  • @jovotech/cli-command-new: 4.1.6
  • @jovotech/cli-command-run: 4.1.7
  • @jovotech/cli-core: 4.1.7
  • @jovotech/common: 4.2.9 -> 4.2.10
  • @jovotech/db-filedb: 4.2.15 -> 4.2.16
  • @jovotech/filebuilder: 0.0.1
  • @jovotech/framework: 4.2.15 -> 4.2.16
  • @jovotech/model: 4.0.0
  • @jovotech/model-nlpjs: 4.0.0
  • @jovotech/nlu-nlpjs: 4.2.15 -> 4.2.16
  • @jovotech/output: 4.2.11 -> 4.2.12
  • @jovotech/platform-core: 4.2.15 -> 4.2.16
  • @jovotech/platform-web: 4.2.15 -> 4.2.16
  • @jovotech/plugin-debugger: 4.2.16 -> 4.2.17
  • @jovotech/server-express: 4.2.15 -> 4.2.16

Environment:
System:
OS: Windows 10 10.0.22000
Binaries:
Node: 14.19.0 - C:\Program Files\nodejs\node.EXE
npm: 8.10.0 - C:\Program Files\nodejs\npm.CMD

Hey, @rmtuckerphx There's a missing / in the URL.

Thanks @aswetlow!

Closing this for now. Let us know if the issue persists @rmtuckerphx