SpeechManager

SpeechManager

A manager class which contains cache for audioStream/SpeechMarks for existing speechs and handles any network calls

Constructor

new SpeechManager()

Methods

(static) getInstance() → {SpeechManager}

Static method to get singleton instance

_getAudioFromCache(config) → (nullable) {AudioBuffer}

Get audioBuffer from cache or return null if not found

Parameters:
Name Type Description
config SpeechManagerConfig

_getRequestFromCache(config) → (nullable) {Promise}

Get polly request from cache or return null if not found

Parameters:
Name Type Description
config SpeechManagerConfig

_getSpeechMarkFromCache(config) → (nullable) {Object}

Get speechMarks from cache or return null if not found

Parameters:
Name Type Description
config SpeechManagerConfig

getAudioAndSpeechMark(config) → {Promise}

Get the audioBuffer and speechMarks for requested config - it will try to pull these from the cache if possible, otherwise
it will add a request to cache the config to the cache.

Parameters:
Name Type Description
config SpeechManagerConfig

postConfig(config)

Process the requested config or put in queue to be pick up later

Parameters:
Name Type Description
config SpeechManagerConfig