- cd to speechAPI.py (download at https://github.com/pkailin/ASR_NeMO/blob/main/speechAPI.py) and run "python speechAPI.py" on cmd
- Open chrome by typing "chrome.exe --user-data-dir="C:\Chrome dev session" --disable-web-security" on cmd after changing directory to where chrome.exe can be found (eg: "C:\Program Files\Google\Chrome\Application"). This is to prevent API calls from returning "XMLHttpRequest blocked by CORS Policy".
- Open modules/channel-web/assets/examples/embedded-webchat.html on chrome and subsequently "http://localhost:3000/assets/modules/channel-web/examples/embedded-webchat.html?botId=flight-booking" with the botId changed accordingly.
- Press config 1 to enable voice composer and test out speech-to-text feature
The custom component creates a new interface for the composer and overwrites the existing composer
- In modules/channel-web/assets/examples/embedded-webchat.html, uncomment line 68 to 90 and comment out line 91 to 93.
- In packages/bp/dist/data/global/bot.config.json, add in:
"modules": [ ... { "location": "MODULES_ROOT/custom-component", "enabled": true } ]
- yarn cache clean (proceed to the next step if this command fails)
- yarn
- yarn build
- yarn start
if any code changes made to any modules, cd to module itself and do yarn && yarn build, then cd back to botpress-master and yarn start.
- modules/channel-web/assets/examples/embedded-webchat.html
- packages/bp/dist/data/global/bot.config.json
- modules/channel-web/src/views/lite/components/Composer.tsx
- added modules/custom-component folder