- This project was generated with Angular CLI version 8.2.0
- Audio handled by howler.js
- Base Polly code example started from here
- Humour provided by the groan-worthy, icanhazdadjoke API
- Voices are made possible by Amazon Polly
To get this working:
- Add the following line to
polyfills.ts
:
(window as any).global = window;
- add @types/node package (via npm or yarn)
- change the following line in
tsconfig.app.json
from this:
"types": []
to this:
"types": ["node"]
Your mileage may vary
๐ก I learned that change detection in Angular needs an app.tick() when the change occurs within a callback function.
๐ Working from the Polly base code example here, I found that the following lines where throwing errors in my angular app:
var polly = new AWS.Polly({ apiVersion: "2016-06-10" });
var signer = new AWS.Polly.Presigner(speechParams, polly);
I wound up removing the first line and the all of the arguments on the signer
to get things working without errors.
const signer = new AWS.Polly.Presigner();