amazon-sumerian-hosts icon indicating copy to clipboard operation
amazon-sumerian-hosts copied to clipboard

Reusing Polly existing file content rather than calling AWS every time?

Open mikaelwozniak opened this issue 4 years ago • 4 comments

If my application has a set list of hardcoded texts to be said by the virtual host, I shouldn’t need to call AWS Polly every time a new visitor comes on my webpage. I should just have the mp3/api-call-result files saved somewhere and link with those static files.

What is the easiest way to achieve this with this repo code? Many Thanks.

mikaelwozniak avatar Mar 30 '21 02:03 mikaelwozniak

Hey @mikaelwozniak, this library is not currently designed to support storing and replaying audio. That said, if you wanted to achieve that you could look into creating some custom functionality with the resulting pre-signed url returned from AWS Polly:

  • https://github.com/aws-samples/amazon-sumerian-hosts/blob/mainline/src/core/awspack/AbstractTextToSpeechFeature.js#L654-L676
  • https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Polly.html#synthesizeSpeech-property

jkerste avatar Sep 21 '21 00:09 jkerste

@mikaelwozniak Any luck with this? I'm trying to do the same thing

charles-hay avatar Feb 03 '22 21:02 charles-hay

@mikaelwozniak and @charles-hay, can you explain what your motivation is for wanting to use locally cached audio and viseme data? Amazon Polly automatically serves cached versions of that data when called with the same parameters (voice ID, speech text, language ID). There's no cost to you when that happens. You only pay when unique new audio is generated. So you wouldn't be saving cost. Is there some other benefit you're looking to achieve with local caching?

Krxtopher avatar Jul 07 '22 20:07 Krxtopher

... @mikaelwozniak oh well I wasted a lot of time 😓

charles-hay avatar Jul 08 '22 01:07 charles-hay