ApiApp().RegisterSetVoiceFontFunction
Sets a custom Text-To-Speech library (.dll include or similar), as the new delegate for the Voice Output layer, you can then script changes of the voice font used for speech output.
Description
Custom Text-To-Speech libraries can be delegated out by the SILVIA Core in order to direct the Voice Output FIFO stack and process any SSML / speech tags embedded in Exuders. These SSML / speech tags are removed from the Text Output Stack automatically when Exuders execute.
If no custom delegate is set, System Native voices will still function in the SILVIA Studio, but it is recommended that developers obtain their own Text-To-Speech plugin for deployments, as Text-To-Speech is not native to the SILVIA Core.
DLL / Library “includes” can be made by reference in C# scripts, the script can then subscribe to external methods pertaining to TTS speech out. Creating a TTS wrapper script that polls the Voice Out FIFO stack from the SILVIA Core enables use of SSML / speech tags through the assigned DLL / Library. See the “ApiApp().GetVoiceOutput” function regarding the Voice Output stack. SDKs supplied with TTS libraries generally list all of the methods necessary to send text in, get speech out, track the status of speech, etc.
Some TTS providers list support for C# in their API or SDK documentation as “.NET”, so be sure to check.
Example Usage (C#)
[DllImport("CustomVoiceLibrary")]
private static extern bool CustomVoiceSetFont(string gender, string name, int
rate);
_core.ApiApp().RegisterSetVoiceFontFunction(CustomVoiceSetFont);
function |
delegate |
The name of the delegate Method or Function that supplies the overloads of the “ApiApp().SetVoiceFont” function to the included TTS / speech library. Typically an external method called within a TTS library that returns a bool indicating success or failure. The exact name of the library and function may vary depending on the TTS used. |
Returns
The boolean success or failure of the operation.
See Also
- ApiApp().SetVoiceOutput
- ApiApp().LoadVisemes
- ApiApp().GetVoiceFontGender
- ApiApp().GetVoiceFontName
- ApiApp().GetVoiceFontRate
- ApiApp().GetVoiceOutput