TTS Cache Options
Two options can be used for TTS caching with the Voice SDK TTS package:
The TtsMemoryCache holds loaded TTS clips and returns them immediately if a load request is made for the same clip. The memory cache will keep all files in memory indefinitely unless a LRU (Least Recently Used) clip limit or RAM limit is placed on it. When a limit has been passed, the TtsMemoryCache will automatically unload the least recently used TTS clips. The TtsMemoryCache uses the following parameters:
Is Clip Capacity Enabled: Whether a clip total should be limited.
Clip Capacity: The maximum number of clips allowed when limited.
Is Memory Capacity Enabled: Whether the runtime cache should limit clips loaded based on RAM.
Memory Capacity in Kilobytes: Capacity of the runtime cache when limited (in KB).
The storage cache used for handling storage and streaming of files from disk. This cache allows for downloading TTS files to disk so that they will load quicker on subsequent use. While the TtsStorageCache contains default settings to be used with TTS requests, these can be overridden on a per request basis. The TtsStorageCache has the following parameters:
Cache Directory: The path for the disk cache relative to the disk cache location.
Default Cache Location: The default kind of disk caching to use when. Available options for the disk cache location.
None: No disk caching is used.
Content: Files will be loaded from the Content directory. When running in editor using this setting will also save clips to the content folder so they can be loaded or used later.
Persistent: Uses the application’s on device persistent directory, which will remain on disk until deleted. This should only be used for a very limited number of clips.
Temporary: Uses the application’s on device temporary directory which will remain on disk until the device decides it should be deleted.