The KMouth Handbook

# The KMouth Handbook

Gunnar Schmi Dt `<gunnar@schmi-dt.de>`

Revision 1.2.0 (KDE Gear 22.04) (2022-03-18)

Copyright © 2002, 2003 Gunnar Schmi Dt

Legal Notice

KMouth is an application that enables persons that cannot speak to let their computers speak.

Chapter 1. Introduction
Introduction

# Chapter 1. Introduction

KMouth is a program that enables persons that cannot speak to let their computers speak. It includes a history of spoken sentences from which the user can select sentences to be re-spoken.

Note that KMouth does not include any speech synthesizers. Instead it requires a speech synthesizer installed in the system.

Chapter 2. Using KMouth
Using KMouth

# Chapter 2. Using KMouth

## The First Time Setup

During the first use of KMouth, a wizard is displayed in which you can configure it.

With the first page of the wizard you specify the engine and voice that shall be used for the text-to-speech conversion. For more details look into the description of the configuration dialog.

With the third page you define the dictionary for a word completion. KMouth will parse the KDE documentation of the chosen language in order to detect the regularity of individual words. Optionally you can compare the word list to an OpenOffice.org dictionary in order to only add correctly spelled words to the word completion.

The Main Window
The Main Window

## The Main Window

The main window of KMouth is fairly simple. It consists basically of an edit field into which you type your sentences (the lower white field in the screen shot) and a history of spoken sentences (the upper white field in the screen shot).

Assuming that you have correctly configured KMouth you can use the edit field for entering sentences you want to hear. Once a sentence got spoken it will be appended to the history. From the history you can select sentences to be re-spoken.

From the phrase books (located in the line below the tool bar) you can select often used phrases.

The Configuration Dialog
The Configuration Dialog

## The Configuration Dialog

By using the menu entry Settings → Configure KMouth... you open the configuration dialog of KMouth. This dialog consists of the pages General Options with the two tabs Preferences and Text-to-Speech and the page Word Completion.

### The Preferences tab

The Preferences tab contains options that alter the behavior of KMouth in certain situations.

With the first combo box Selection of phrases in the phrase book you specify which action is triggered by typing the shortcut of a phrase or by selecting a phrase in the Phrase Book menu or in the phrase book bar.

By selecting Speak Immediately the selected phrase gets immediately spoken and is entered into the history. If you select Insert Into Edit Field the selected phrase is just inserted into the edit field.

With the second combo box, Closing the phrase book edit window, you specify whether the phrase book gets saved if you just close the phrase book edit window.

By selecting Save Phrase Book the phrase book gets saved. If you select Discard changes the changes are discarded and the phrase book is not saved. If you select Ask Whether to Save KMouth will ask you whether it shall save the phrase book.

### The Text-to-Speech tab

By selecting Use default speech system you tell KMouth first to try to use the system speech service prior to calling the speech synthesizer directly. If this succeeds the other configuration entries on this tab are ignored. The system speech service is a Qt™ library which wraps speech-dispatcher on Linux®, and native speech systems on other platforms. On a Debian based system you need the packages speech-dispatcher, libqt5texttospeech5 and one of the speech-dispatcher modules, usually espeak.

### Note

Use the commandline tool spd-conf (Debian package python3-speechd) to adjust settings like rate, pitch, volume, voice type and language etc. for the default speech system. Additionally spd-conf will let you choose between all installed speech-dispatcher modules, i.e. espeak, festival, flite, mbrola etc.

It is also possible to select the Engine and Voice for the speech system.

Should the Use default speech system item is not selected you can enter the command for calling the speech synthesize into the edit field of the Alternative panel. With the combo box below the edit field you specify the character encoding that is used for passing the text to the speech synthesizer.

KMouth knows two ways of passing the text: If the command expects the text as standard input you select the check box.

The other way is to pass the text as a parameter: Before calling the command KMouth replaces certain placeholders with actual content:

Placeholder | Replaced with
--- | ---
%t | The actual text that should be spoken
%f | The name of a temporary file that contains the text that should be spoken
%l | The language code associated with the current word completion dictionary
%% | A percent sign

Of course the command for speaking texts is dependent on which speech synthesizer you use. Please look into the documentation of your speech synthesizer for the command for speaking texts.

### The Word Completion page

The Word Completion page contains a list of dictionaries used for the word completion. (KMouth will display a combo box next to the edit field in the main window if this list contains more than one dictionary. You can use this combo box in order to select the dictionary that actually gets used for the word completion.)

With the buttons on the right side of the page you can add and delete dictionaries, change the order of the dictionaries or export dictionaries to a file. With the edit field and the combo box below the list you can change the name and the language associated with the dictionary.

When you add a new dictionary you may choose between several sources:

- Create a new dictionary from the KDE documentation

  If you use this source KMouth will ask you for the intended language and afterwards parse the KDE documentation. The frequentness of the individual words is detect by simply counting the occurrences of each word. Optionally you can compare the word list to an OpenOffice.org dictionary in order to only add correctly spelled words to the new dictionary.

- Create a new dictionary from a file

  If you use this source KMouth will ask you for the intended file. You may either select an XML file, a standard text file or a file containing a word completion dictionary created by either KMouth or GOK (the GNOME On-screen Keyboard). If you select a standard text file or an XML file the frequentness of the individual words is detected by simply counting the occurrences of each word. Optionally you can compare the word list to an OpenOffice.org dictionary in order to only add correctly spelled words to the new dictionary.

- Create a new dictionary from a folder

  If you use this source KMouth will ask you for the intended folder. KMouth will open all files in that folder and its subfolders. Each file is either loaded as a completion dictionary, as an XML file or as a standard text file. In the latter two cases the occurrences of each individual word in the file is counted. Optionally you can compare the word list to an OpenOffice.org dictionary in order to only add correctly spelled words to the new dictionary.

- Merge dictionaries

  You can use this option in order to merge the available dictionaries. KMouth will ask you which dictionaries should be merged and how the individual dictionaries should be weighted.

- Create an empty word list

  You can use this option in order to create a blank dictionary without any entries. As KMouth automatically adds newly typed words to the dictionaries it will learn your vocabulary with the time.

The Phrase Book Edit Window
The Phrase Book Edit Window

## The Phrase Book Edit Window

By using the menu entry Phrase Books → Edit... you open the phrase book edit window.

The main area of the phrase book edit window is divided into two parts. Within the upper part the phrase books are displayed in some tree structure.

Within the lower part you may modify a selected item. If you have selected a phrase you can modify the contents of the phrase as well as its shortcut. If you have selected a phrase book you can only change its name.

Actions like adding new phrases and phrase books and deleting selected phrases and phrase books can be done by selecting them in either the menu bar, the toolbar or a pop up menu.

You can change the order of the phrase books and phrases by dragging them to their new places or by using the arrow keys while the Alt key is pressed.

Chapter 3. Command Reference
Command Reference

# Chapter 3. Command Reference

## Commands Within The Main Window

### The File Menu

File → Open as History... (Ctrl+O)

  Opens a text file into as history of spoken sentences.

File → Save History As... (Ctrl+S)

  Saves the history into a text file.

File → Print History... (Ctrl+P)

  Prints the history.

File → Quit (Ctrl+Q)

  Quits KMouth

### The Edit Menu

Edit → Cut (Ctrl+X)

  Cuts the selected section and puts it to the clipboard. If there is some text selected in the edit field it is placed in the clipboard. Otherwise the selected sentences in the history (if any) are placed in the clipboard.

Edit → Copy (Ctrl+C)

  Copies the selected section to the clipboard. If there is some text selected in the edit field it is copied to the clipboard. Otherwise the selected sentences in the history (if any) are copied to the clipboard.

Edit → Paste (Ctrl+V)

  Pastes the clipboard contents at the current cursor position into the edit field.

Edit → Speak

  Speaks the currently active sentence(s). If there is some text in the edit field it is spoken. Otherwise the selected sentences in the history (if any) are spoken.

### The Phrase Books Menu

Phrase Books → Edit...

  Opens the phrase book edit window.

KMouth has the common KDE Settings and Help menu items, for more information read the sections about the Settings Menu and Help Menu of the KDE Fundamentals.

Commands within the phrase book edit window
Commands within the phrase book edit window

## Commands within the phrase book edit window

### The File Menu

File → New Phrase

  Adds a new phrase.

File → New Phrase Book

  Adds a new phrase book.

File → Save (Ctrl+S)

  Saves the phrase book.

File → Import...

  Imports a file and adds its contents to the phrase book

File → Import Standard Phrase Book

  Imports a standard phrase book and adds its contents to the phrase book

File → Export...

  Exports the currently selected phrase(s) or phrase book(s) to a file

File → Close (Ctrl+W)

  Closes the window

### The Edit Menu

Edit → Cut (Ctrl+X)

  Cuts the selected items and puts it to the clipboard.

Edit → Copy (Ctrl+C)

  Copies the selected items to the clipboard.

Edit → Paste (Ctrl+V)

  Pastes the clipboard contents into the phrase book.

Edit → Delete

  Deletes the selected items.

### The Help Menu

The items in this menu are the same as in the main window.

### The Pop up Menu

New Phrase

  Adds a new phrase.

New Phrase Book

  Adds a new phrase book.

Import...

  Imports a file and adds its contents to the phrase book

Import Standard Phrase Book

  Imports a standard phrase book and adds its contents to the phrase book

Export...

  Exports the currently selected phrase(s) or phrase book(s) to a file

Cut (Ctrl+X)

  Cuts the selected items and puts it to the clipboard.

Copy (Ctrl+C)

  Copies the selected items to the clipboard.

Paste (Ctrl+V)

  Pastes the clipboard contents at this position into the phrase book.

Delete

  Deletes the selected items.

Chapter 4. Credits and License
Credits and License

# Chapter 4. Credits and License

KMouth

Program copyright 2002-2004 Gunnar Schmi Dt `(gunnar AT schmi-dt.de)`

Documentation copyright 2002-2004 Gunnar Schmi Dt `(gunnar AT schmi-dt.de)`

This documentation is licensed under the terms of the GNU Free Documentation License.

This program is licensed under the terms of the GNU General Public License.