Espeak Plugin
Introduction
Rockbox version available on this site contains a Espeak plugin, which allows you to read a plain text files in utf-8 encoding. It uses a free TTS, Espeak. A port of this speech synthesis for RB was created in 2007 by Rockbox developer Toni. His work was not accepted in RB because of license reasons (More information in Discussion board ). I edited this plugin at the end of last year, so now it can read a plain text files.
It contains version of Espeak from 2007, so there are limitations, which were in this version of Espeak.
How it works
When you click on the file with .txt extension, Espeak plugin will load this file. At the beginning, plugin will say "ready to read". Use the following buttons to control this plugin on Sansa Clip Plus player:
- To move between paragraphs (carriage returns) use play and submenu buttons (up and down arrows).
- short press of select Button will activate or deactivate the say all function from position of cursor.
- Use a volume buttons to set volume.
- to open a context menu press and hold the select button.
- to return to the file manager (exit the Espeak plugin) press the power button.
Speech parameters configuration
In the context menu there are a few commands to controll speech parameters: "select language", "set rate" and "set pitch", so you can set a language, rate and pitch of speech synthesis. Use arrow keys to choose a parameter and select it by pressing the select button. Afterthat use play and submenu buttons to select appropriate value and comfirm it by pressing the select button.
bookmarks
Use the "save bookmark" item to save a current position of the cursor. This position will be saved in file with .bmark extension, which will be stored in the same folder, as the folder where is the opened text file.
The "load bookmark" item loads the saved position. After activating this item, cursor will be moved to the saved position.
The "goto the begining of the file" item moves the cursor to the beginning of opened text file.
Automatic actions
In the plugin's menu you can set automatic actions, which will plugin do after opening a file, directly before the exiting of plugin or when the battery level will be lover than 2 percent. Brief description follows:
what to do after start:
- Do nothing
- start reading: Immediately when is the file loaded, Espeak will start reading the text
- load bookmark: Immediately when is the file loaded, Espeak plugin will try to load a bookmark (if it exists)
- load bookmark and start reading: Combination of both functions listed above.
What to do before exit:
- Do nothing
- save bookmark: Rather than plugin will be closed, it will try to automatically save an actual position of the cursor
- delete the file: Rather than plugin will be closed, it will try to delete an opened file
What to do when battery reaches 2%:
- don't care: Espeak will not control current battery status
- warn me: Plugin will stop reading and will announce the critical status of battery
- exit the plugin: plugin will try to close itself, and also the automatic action associated with the "What to do before exit" option will be performed.
Configuration saving
By activating the "save configuration" item you can save actual speech parameters (rate, pitch and language) to the file. File named espeak.config will be created in the same folder, where is the currently opened text file.
The configuration file is loaded immediately after plugin is launched and it works as follows:
- Firstly, the plugin will try to find the file espeak.config in the same folder, where is the file, which you want to read (for example file /txt/english/books/book.txt). Espeak will look for file /txt/english/books/espeak.config. If Espeak will find this file, it will load this file and it will also load a appropriate text file.
- If the configuration file can not be found in the folder tryed in first step, Espeak will try to find this file in parent directory. I. e. /txt/english/espeak.config. When Espeak finds this file here, it will load it and also the appropriate text file will be loaded.
- If Espeak can not find configuration file here, it will try to find it in higher level, until it will reach the root directory of the player. If coNfiguration file is not here, Espeak will use default settings.
Function, which is described above allows you to create special settings for text files in different languages so you create convenient folder structure and copy the configuration files to parent directoryes.
Example: We have a folder called txt. In this folder are subfolders: slovak, czech, and english. In every of this folder create any structure (magazines, books, articles,...). Now Open any txt file for example in folder txt/slovak/books. Set speech parameters to Slovak language, and maximum rate and save the configuration. Afterthat exit the plugin. Now, there is a espeak.config file in folder /txt/slovak/books. Now cut This file using the appropriate item in context menu, and in folder tree wiev move to the txt/slovak folder and paste configuration file here. When you open any file from txt/slovak folder or it's subfolders, Espeak plugin will automatically load configuration file which you created.
Adding a paragraph to notes
Use the function "add to notes.txt" to append currently selected paragraph to the notes.txt file.
In the first step, the plugin looks whether there exists a notes.txt file in the directory where is currently opened txt file located, or in the parrent directories (this is similar to config file loading - see abowe). If the file exists, then the plugin appends the paragraph to the end of the file.
If there is not a notes.txt file, then the plugin creates it automatically in the folder, where is currently opened txt file located and the selected paragraph is added to this file.