Function set_preference

Source
pub fn set_preference(name: String, value: String) -> Result<()>
Expand description

Set a MathCAT preference. The preference name should be a known preference name. The value should either be a string or a number (depending upon the preference being set) The list of known user preferences is in the MathCAT user documentation. Here are common preferences set by programs (not settable by the user):

  • TTS – SSML, SAPI5, None
  • Pitch – normalized at ‘1.0’
  • Rate – words per minute (should match current speech rate). There is a separate “MathRate” that is user settable that causes a relative percentage change from this rate.
  • Volume – default 100
  • Voice – set a voice to use (not implemented)
  • Gender – set pick any voice of the given gender (not implemented)
  • Bookmark – set to true if a mark/bookmark should be part of the returned speech (used for sync highlighting)

Important: both the preference name and value are case-sensitive

This function can be called multiple times to set different values. The values are persistent and extend beyond calls to set_mathml. A value can be overwritten by calling this function again with a different value.

Be careful setting preferences – these potentially override user settings, so only preferences that really need setting should be set.