问题
I'm using the LUIS bot in NodeJS and I am using session.say()
to get the bot the speak but there is not audio output. I am trying to say a list of movies from a list like this session.say('hi', list.shift())
I know it works because 'hi' prints in the chat but no audio, I even put it in SSML format
session.say('hi','<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US">hey</speak>');
Any ideas why my bot isn't saying anything, but still printing stuff in the chat?
回答1:
To use the text to speech feature on the Bot Framework Emulator, the user has to use the microphone on the emulator first. Basically, the bot will only speak to the user if the user speaks to the bot first. Note, there are several steps you need to follow to enable the microphone feature on the emulator:
- If you do not already have a microsoftAppId and microsoftAppPassword for your bot, you will either have to create a new bot or register your bot on the Azure Portal. Be aware that if you choose to register your bot, you will not be able to deploy it later without creating a new bot.
Once you have your microsoftAppId and microsoftAppPassword, you will have to create a
.env
file to store them. It should look like:MicrosoftAppId=YOUR_MICROSOFT_APP_ID MicrosoftAppPassword=YOURR_MICROSOFT_APP_PASSWORD
Also, make sure you have configured the
dotenv
in yourapp.js
file.- Now, you have to either add your microsoftAppId and microsoftAppPassword to the developer endpoint in your bot file or add it through the emulator. To add it in the emulator, right click on your bot under the
ENDPOINT
section and selectEdit Settings
. It should open a prompt where you can fill in the microsoftAppId and microsoftAppPassword.
Once you have completed all of the steps above, run your bot and connect to it in the emulator. You should be able to use the microphone to talk to your bot, and the bot should respond by speaking some text. Hope this helps.
来源:https://stackoverflow.com/questions/53600369/luis-bot-not-speaking