Stellarium  25.4
Public Slots | Signals | Public Member Functions | Properties
StelSpeechMgr Class Reference

Provides artificial voice output for a narration on sky objects or GUI elements. More...

#include <StelSpeechMgr.hpp>

Public Slots

void say (const QString &narration) const
 Emit an audible synthesized narration.
 
void stop () const
 Stops replay of narration.
 
bool enabled () const
 global info, always false if Qt<6.6 and if no engine was initialized
 
void setRate (double newRate)
 set replay rate (-1...+1)
 
double getRate () const
 
void setPitch (double newPitch)
 set pitch (-1...+1)
 
double getPitch () const
 
void setVolume (double newVolume)
 set volume (0...+1)
 
double getVolume () const
 

Signals

void rateChanged (double)
 
void pitchChanged (double)
 
void volumeChanged (double)
 

Public Member Functions

void init () override
 Initialize itself. More...
 
const StelObject::InfoStringGroup & getNarrationTextFilters () const
 Get the module ID, returns "StelSpeechMgr". BUT FOR WHAT PURPOSE? More...
 
void setNarrationTextFilters (const StelObject::InfoStringGroup &flags)
 Set the currently active flags which information bits to narrate.
 
- Public Member Functions inherited from StelModule
 StelModule ()
 Constructor. Every derived class MUST call setObjectName(className) in its constructor.
 
virtual void deinit ()
 Called before the module will be deleted, and before the OpenGL context is suppressed. More...
 
virtual QSettings * getSettings ()
 Return module-specific settings. More...
 
virtual void draw (StelCore *core)
 Execute all the drawing functions for this module. More...
 
virtual void update (double deltaTime)
 Update the module with respect to the time. More...
 
virtual QString getModuleVersion () const
 Get the version of the module, default is stellarium main version.
 
virtual QString getAuthorName () const
 Get the name of the module author.
 
virtual QString getAuthorEmail () const
 Get the email address of the module author.
 
virtual void handleMouseClicks (class QMouseEvent *)
 Handle mouse clicks. More...
 
virtual void handleMouseWheel (class QWheelEvent *)
 Handle mouse wheel. More...
 
virtual bool handleMouseMoves (int x, int y, Qt::MouseButtons b)
 Handle mouse moves. More...
 
virtual void handleKeys (class QKeyEvent *e)
 Handle key events. More...
 
virtual bool handlePinch (qreal scale, bool started)
 Handle pinch gesture events. More...
 
virtual double getCallOrder (StelModuleActionName actionName) const
 Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations. More...
 
virtual bool configureGui (bool show=true)
 Detect or show the configuration GUI elements for the module. More...
 

Properties

double rate
 
double pitch
 
double volume
 

Additional Inherited Members

- Public Types inherited from StelModule
enum  StelModuleSelectAction { AddToSelection , ReplaceSelection , RemoveFromSelection }
 Enum used when selecting objects to define whether to add to, replace, or remove from the existing selection list. More...
 
enum  StelModuleActionName {
  ActionDraw , ActionUpdate , ActionHandleMouseClicks , ActionHandleMouseMoves ,
  ActionHandleKeys
}
 Define the possible action for which an order is defined. More...
 
- Protected Member Functions inherited from StelModule
class StelActionaddAction (const QString &id, const QString &groupId, const QString &text, QObject *target, const char *slot, const QString &shortcut="", const QString &altShortcut="")
 convenience methods to add an action (call to slot) to the StelActionMgr object. More...
 
class StelActionaddAction (const QString &id, const QString &groupId, const QString &text, const char *slot, const QString &shortcut="", const QString &altShortcut="")
 convenience methods to add an action (call to own slot) to the StelActionMgr object. More...
 
StelActionaddAction (const QString &id, const QString &groupId, const QString &text, QObject *contextObject, std::function< void()> lambda, const QString &shortcut="", const QString &altShortcut="")
 convenience methods to add an action (call to Lambda functor) to the StelActionMgr object. More...
 

Detailed Description

Provides artificial voice output for a narration on sky objects or GUI elements.

Sometimes, in the dark you may want voice output over reading small text on the screen. Calling a "narrate" action (default: Shift+R) for the selected object will provide some information.

Parallel to the InfoString settings which decide what information items to show, we use a similar structure to decide what data elements are being narrated.

Note
: This functionality requires Qt6.4 and higher or else just emits the narration to logfile.
You can finetune the amount of speech-related messages in the logfile by configuring the logging category stel.Speech. For this, e.g. set environment variable QT_LOGGING_RULES="*.debug=false;stel.Speech.debug=false;". By default, for this new module, all messages are displayed. Later we will limit this to the Info category.

Member Function Documentation

◆ getNarrationTextFilters()

const StelObject::InfoStringGroup& StelSpeechMgr::getNarrationTextFilters ( ) const

Get the module ID, returns "StelSpeechMgr". BUT FOR WHAT PURPOSE?

Retrieve the currently active flags which information bits to narrate

◆ init()

void StelSpeechMgr::init ( )
overridevirtual

Initialize itself.

If the initialization takes significant time, the progress should be displayed on the loading bar.

Implements StelModule.