ApiApp() Functions
This class, implemented as part of the SILVIA C# API, provides access to SILVIA’s application interfaces. These interfaces are for applications to communicate with the SILVIA Core about application-specific data. For instance, the parent application can sample the SILVIA Core’s text output, and modify a TextBox that is visible to the user based on that sampling.
While you can define a “public SilviaCore” reference in external C# scripts by whatever name you choose, for all internal scripting, the Silvia Core is referred to as “_core”, e.g. “_core.ApiApp()…”
Discussion
The ApiApp() section covers some functions that would be run at application startup or upon loading a SILVIA Core, and some functions that may be changed or toggled throughout runtime. ApiApp() notably has methods for delegating out custom speech and setting the voice type and output, as well as methods that enable and disable the various SILVIA output stacks.
As an example, the SILVIA Studio Brain Controls Panel, where you can chat with the loaded SILVIA Core, calls a CheckChatListener method periodically during its update loop to poll whether the ApiApp().GetTextOutput stack has responses from SILVIA to display for the chat log. As follows:
Example Usage (C#)
private bool CheckChatListener() {
if (_core == null) {
return false;
} else {
string textOutput = null;
string results = string.Empty;
while (!string.IsNullOrEmpty(
textOutput = _core.ApiApp().GetTextOutput())) {
results += "" + OutputName.ToUpper() + ": " + textOutput;
}
}
return true;
}
The various FIFO output stacks available through ApiApp() include Text, Voice, Application Message, Diagnostic, and Socket. They can be enabled or disabled by commands hereinbelow.
Note: The Avatar System is being reimplemented for SILVIA Studio 3 and support for legacy Viseme functions is deprecated.
ApiApp()
This class, implemented as part of the SILVIA C# API, provides access to SILVIA’s application interfaces.
- ApiApp().SetVoiceFont
- ApiApp().SetVoiceType
- ApiApp().GetVoiceType
- ApiApp().GetVoiceFontGender
- ApiApp().GetVoiceFontName
- ApiApp().GetVoiceFontRate
- ApiApp().LoadVisemes*
- ApiApp().LoadVisemesCrop*
- ApiApp().GetVisemesFolder*
- ApiApp().EnableVoiceOutput
- ApiApp().VoiceOutputEnabled
- ApiApp().EnableTextOutput
- ApiApp().RegisterSetVoiceFontFunction
- ApiApp().TextOutputEnabled
- ApiApp().EnableSocketOutput
- ApiApp().SocketOutputEnabled
- ApiApp().EnableDiagOutput
- ApiApp().EnableApplicationMessage
- ApiApp().ApplicationMessageEnabled
- ApiApp().SetVoiceOutput
- ApiApp().GetVoiceOutput
- ApiApp().ClearVoiceOutput
- ApiApp().GetApproximateSpeechLength
- ApiApp().IsSpeaking
- ApiApp().SetIsSpeaking
- ApiApp().SetTextOutput
- ApiApp().GetTextOutput
- ApiApp().ClearTextOutput
- ApiApp().SetSocketOutput
- ApiApp().SetDiagOutput
- ApiApp().GetDiagOutput
- ApiApp().ClearDiagOutput
- ApiApp().SetApplicationMessage
- ApiApp().GetApplicationMessage
- ApiApp().ClearApplicationMessage
- ApiApp().SetPagerTagsOutput
- ApiApp().GetPagerTagsOutput
- ApiApp().ClearPagerTags
- ApiApp().SetListening
- ApiApp().IsListening