Skip to content

Commit b325f8b

Browse files
committed
- TTS will use en as its default language
- adding TTS documentation
1 parent 4467999 commit b325f8b

File tree

12 files changed

+392
-19
lines changed

12 files changed

+392
-19
lines changed

devel/pre-commit

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ for afile in index.md \
159159
rec-dir.md \
160160
buffering.md \
161161
m3u.md \
162-
validate_playlist.md
162+
validate_playlist.md \
163+
tts.md
163164
do
164165
sed -i -e "s/'s-/s-/g" -e "s/s'-/s-/g" "$afile"
165166
git add "$afile"
@@ -208,6 +209,8 @@ do
208209
echo '% PyRadio M3U Playlist Support' > tmp.md
209210
elif [ "$afile" = "validate_playlist.md" ];then
210211
echo '% PyRadio Playlist Validation Guide' > tmp.md
212+
elif [ "$afile" = "tts.md" ];then
213+
echo '% PyRadio Text-to-Speech Support' > tmp.md
211214
fi
212215
cat ${afile} >> tmp.md
213216
pandoc --wrap=none -s -t html tmp.md -o ${out} || {

docs/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
151151
<li><a href="#remote-control-client">Remote Control Client</a></li>
152152
</ul></li>
153153
<li><a href="#playing-a-station-in-the-terminal">Playing a station in the terminal</a></li>
154+
<li><a href="#text-to-speech-support">Text-to-Speech Support</a></li>
154155
<li><a href="#debug-mode">Debug mode</a></li>
155156
<li><a href="#reporting-bugs">Reporting bugs</a></li>
156157
<li><a href="#packaging-pyradio">Packaging PyRadio</a></li>
@@ -2464,6 +2465,9 @@ <h2 id="playing-a-station-in-the-terminal">Playing a station in the terminal <sp
24642465
<p>After the player stops, <strong>PyRadio</strong> will stop as well.</p>
24652466
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> On Windows, <strong>mpv</strong> and <strong>VLC</strong> will open a new player window instead of executing in the terminal.</p>
24662467
<p>In addition, a command line parameter has been added “<em>-x</em>” (“<em>–exteranl-player</em>”) which when used in conjuction with the “<em>-p</em>” (“<em>–play</em>”) command line parameter, will instruct <strong>PyRadio</strong> to play a station and terminate after the playback stops.</p>
2468+
<h2 id="text-to-speech-support">Text-to-Speech Support <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
2469+
<p><strong>PyRadio</strong> now features comprehensive Text-to-Speech (TTS) support, providing auditory feedback for an enhanced radio streaming experience. This intelligent system delivers contextual information about station navigation, playback status, and system events.</p>
2470+
<p>More info about the implementation and status at the <a href="tts.html">relevant page</a>.</p>
24672471
<h2 id="debug-mode">Debug mode <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
24682472
<p>Adding the “<strong>-d</strong>” option to the command line will instruct <strong>PyRadio</strong> to enter <em>Debug mode</em>, which means that it will print debug messages to a file. This file will always reside in the user’s home directory and will be named <em>pyradio.log</em>.</p>
24692473
<p>In case of a bug or a glitch, please include this file to the issue you will <a target="_blank" href="https://github.com/coderholic/pyradio/issues">open at github</a>.</p>

docs/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Command line internet radio player.
7676
* [Remote Control Server](#remote-control-server)
7777
* [Remote Control Client](#remote-control-client)
7878
* [Playing a station in the terminal](#playing-a-station-in-the-terminal)
79+
* [Text-to-Speech Support](#text-to-speech-support)
7980
* [Debug mode](#debug-mode)
8081
* [Reporting bugs](#reporting-bugs)
8182
* [Packaging PyRadio](#packaging-pyradio)
@@ -1303,6 +1304,12 @@ After the player stops, **PyRadio** will stop as well.
13031304

13041305
In addition, a command line parameter has been added "*-x*" ("*--exteranl-player*") which when used in conjuction with the "*-p*" ("*--play*") command line parameter, will instruct **PyRadio** to play a station and terminate after the playback stops.
13051306

1307+
## Text-to-Speech Support
1308+
1309+
**PyRadio** now features comprehensive Text-to-Speech (TTS) support, providing auditory feedback for an enhanced radio streaming experience. This intelligent system delivers contextual information about station navigation, playback status, and system events.
1310+
1311+
More info about the implementation and status at the [relevant page](tts.md).
1312+
13061313
## Debug mode
13071314

13081315
Adding the "**-d**" option to the command line will instruct **PyRadio** to enter *Debug mode*, which means that it will print debug messages to a file. This file will always reside in the user's home directory and will be named *pyradio.log*.

docs/tts.html

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="generator" content="pandoc" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
7+
<title>PyRadio Text-to-Speech Support</title>
8+
<style>
9+
body {padding: 2em;}
10+
@media screen and (max-width: 770px) {
11+
body {padding: 10px;}
12+
}
13+
body {max-width: 750px; margin: auto;}
14+
h2 {margin-top: 2.5em; border-bottom:1px solid SaddleBrown; color: SaddleBrown;}
15+
h3 {margin-top: 2em; color: SaddleBrown; text-decoration: underline SaddleBrown}
16+
h4 {margin: 2em 0 1em 0; color: SaddleBrown; font-size: 1em;}
17+
h4:before {content: "# "; font-weight: bold; vertical-align: middle;}
18+
h5 {margin: 2em 0 1em 0; color: SaddleBrown; font-size: 1em;;}
19+
h5:before {content: "## "; font-weight: bold; vertical-align: middle;}
20+
p, table, ol, ul {margin-left: .8em;}
21+
STRONG {color: SaddleBrown;}
22+
dl {margin: 2em;}
23+
dd {margin: 1em;}
24+
dt {font-weight: bold;}
25+
TABLE {border: 1px solid SaddleBrown; border-collapse: collapse; margin-left: auto; margin-right: auto; border-radius: 5px; -moz-border-radius: 5px; border-collapse:separate; box-shadow: 5px 5px 15px #888888;}
26+
TH {text-align: left; vertical-align: top; padding: 5px;color: SaddleBrown;border: 1px solid SaddleBrown; background-color: SaddleBrown; color: white;}
27+
TD {text-align: left; vertical-align: top; padding: 5px 10px;border: 1px solid SaddleBrown;}
28+
pre { background-color: rgba(245, 245, 245, 1); color: #474747; padding: 1.5em; border: 1px solid #C7C7C7; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; overflow: auto; box-shadow: 5px 5px 15px #C7C7C7;}
29+
.task-list {list-style-type: none; padding: 0; margin: 0 0 0 1em ;}
30+
img{display: block; margin-left: auto; margin-right: auto; max-width: 750px; width: 100%; background:transparent; padding:3px; border:1px solid #999999; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; box-shadow:5px 5px 15px #888888;}
31+
.indented {text-indent: -1.5em; padding-left: 1.5em; margin-left: 1em;}
32+
a{ color: SaddleBrown;}
33+
a:visited{color: SaddleBrown;}
34+
</style>
35+
</head>
36+
<body>
37+
<header id="title-block-header">
38+
</header>
39+
<h1 style="color: SaddleBrown" id="pyradio-text-to-speech-support">PyRadio Text-to-Speech Support</h1>
40+
<h2 id="overview">Overview <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
41+
<p><strong>PyRadio</strong> now features comprehensive Text-to-Speech (TTS) support, providing auditory feedback for an enhanced radio streaming experience. This intelligent system delivers contextual information about station navigation, playback status, and system events.</p>
42+
<h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
43+
<!-- vim-markdown-toc Marked -->
44+
<ul>
45+
<li><a href="#features">Features</a></li>
46+
<li><a href="#activation">Activation</a>
47+
<ul>
48+
<li><a href="#permanent-activation">Permanent Activation</a></li>
49+
<li><a href="#temporary-activation">Temporary Activation</a></li>
50+
</ul></li>
51+
<li><a href="#platform-implementation">Platform Implementation</a>
52+
<ul>
53+
<li><a href="#linux">Linux</a></li>
54+
<li><a href="#windows">Windows</a></li>
55+
<li><a href="#macos">macOS</a></li>
56+
</ul></li>
57+
<li><a href="#language-support">Language Support</a>
58+
<ul>
59+
<li><a href="#voice-characteristics">Voice Characteristics</a></li>
60+
<li><a href="#platform-specific-strategy">Platform-Specific Strategy</a></li>
61+
</ul></li>
62+
<li><a href="#technical-features">Technical Features</a>
63+
<ul>
64+
<li><a href="#smart-queue-management">Smart Queue Management</a></li>
65+
<li><a href="#intelligent-behavior">Intelligent Behavior</a></li>
66+
</ul></li>
67+
<li><a href="#usage-guidelines">Usage Guidelines</a>
68+
<ul>
69+
<li><a href="#for-english-dominant-users">For English-Dominant Users</a></li>
70+
<li><a href="#for-multi-language-content">For Multi-Language Content</a></li>
71+
</ul></li>
72+
<li><a href="#configuration-philosophy">Configuration Philosophy</a></li>
73+
<li><a href="#current-status-&amp;-roadmap">Current Status &amp; Roadmap</a></li>
74+
</ul>
75+
<!-- vim-markdown-toc -->
76+
<p class="indented">[ <a href="index.html#text-to-speech-support">Return to main doc</a> ]</p>
77+
<h2 id="features">Features <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
78+
<p>The TTS system provides spoken feedback for:</p>
79+
<ul>
80+
<li><strong>Station Information</strong>: Station names and numbers during navigation</li>
81+
<li><strong>Playback Status</strong>: Start of playback and connection establishment<br />
82+
</li>
83+
<li><strong>Media Context</strong>: Song titles when available in stream metadata</li>
84+
<li><strong>System Events</strong>: Connection errors and important status changes</li>
85+
<li><strong>Audio Control</strong>: Volume adjustment feedback</li>
86+
</ul>
87+
<h2 id="activation">Activation <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
88+
<h3 id="permanent-activation">Permanent Activation</h3>
89+
<p>Enable TTS permanently through the configuration menu: <strong>Config → TTS → Enable TTS</strong></p>
90+
<h3 id="temporary-activation">Temporary Activation</h3>
91+
<p>Toggle TTS during runtime by pressing <strong>\T</strong> (backslash + T). This setting is session-only and resets when restarting PyRadio.</p>
92+
<h2 id="platform-implementation">Platform Implementation <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
93+
<h3 id="linux">Linux</h3>
94+
<p>Utilizes <strong>speech-dispatcher</strong> configured for English language by default. Provides robust, interruptible speech synthesis with priority-based queue management.</p>
95+
<h3 id="windows">Windows</h3>
96+
<p>Leverages <strong>Windows SAPI (Speech API)</strong> with automatic selection of English voices when available. Features immediate speech interruption and consistent volume control.</p>
97+
<h3 id="macos">macOS</h3>
98+
<p>Employs the native <strong>say command</strong> using the system’s default voice. Most macOS voices support multiple languages natively, handling mixed-language content seamlessly.</p>
99+
<h2 id="language-support">Language Support <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
100+
<h3 id="voice-characteristics">Voice Characteristics</h3>
101+
<p>TTS voices generally fall into two categories:</p>
102+
<p><strong>Monolingual Voices</strong> (typical on Linux/Windows):</p>
103+
<ul>
104+
<li>Specialized in one language</li>
105+
<li>System messages sound clear in English</li>
106+
<li><strong>Non-English characters may be mispronounced or skipped entirely</strong></li>
107+
</ul>
108+
<p><strong>Multilingual Voices</strong> (common on macOS):</p>
109+
<ul>
110+
<li>Automatic language detection and switching</li>
111+
<li>Handle mixed-language content naturally</li>
112+
<li>Provide authentic pronunciation for both system messages and station names</li>
113+
</ul>
114+
<h3 id="platform-specific-strategy">Platform-Specific Strategy</h3>
115+
<ul>
116+
<li><strong>Linux</strong>: English-configured for consistent system messaging</li>
117+
<li><strong>Windows</strong>: Auto-selects English voices while respecting system preferences<br />
118+
</li>
119+
<li><strong>macOS</strong>: Uses default system voice - typically multilingual by design</li>
120+
</ul>
121+
<h2 id="technical-features">Technical Features <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
122+
<h3 id="smart-queue-management">Smart Queue Management</h3>
123+
<ul>
124+
<li>Priority-based processing (HIGH for alerts, NORMAL for navigation)</li>
125+
<li>Pending title queuing after high-priority interruptions</li>
126+
<li>Volume adjustment debouncing</li>
127+
<li>Platform-optimized anti-stutter protection</li>
128+
</ul>
129+
<h3 id="intelligent-behavior">Intelligent Behavior</h3>
130+
<ul>
131+
<li>Critical alerts receive immediate priority</li>
132+
<li>Song titles are queued and spoken after high-priority interruptions</li>
133+
<li>Rapid navigation triggers queue optimization</li>
134+
<li>Volume changes are consolidated to prevent speech spam</li>
135+
</ul>
136+
<h2 id="usage-guidelines">Usage Guidelines <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
137+
<h3 id="for-english-dominant-users">For English-Dominant Users</h3>
138+
<ul>
139+
<li>Default configuration works optimally</li>
140+
<li>System messages and international station names sound natural</li>
141+
</ul>
142+
<h3 id="for-multi-language-content">For Multi-Language Content</h3>
143+
<ul>
144+
<li><strong>macOS</strong>: Handles mixed content seamlessly with multilingual voices</li>
145+
<li><strong>Windows/Linux</strong>: <strong>Non-English characters in station names may not be pronounced correctly</strong></li>
146+
<li>Consider using English names for frequently-accessed stations</li>
147+
</ul>
148+
<h2 id="configuration-philosophy">Configuration Philosophy <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
149+
<p>The system is optimized for English while respecting platform conventions:</p>
150+
<ul>
151+
<li><strong>English-optimized voice selection on Linux and Windows</strong></li>
152+
<li><strong>Multilingual voice support on macOS</strong></li>
153+
<li>Maintains your preferred speech rate and volume</li>
154+
<li>Platform-native experience throughout</li>
155+
</ul>
156+
<h2 id="current-status-roadmap">Current Status &amp; Roadmap <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
157+
<p>This TTS implementation is actively developed. Planned enhancements include:</p>
158+
<ul>
159+
<li>Comprehensive help system narration</li>
160+
<li>Detailed interface element descriptions</li>
161+
<li>Enhanced context-aware speech patterns</li>
162+
<li>Extended configuration options</li>
163+
</ul>
164+
</body>
165+
</html>

docs/tts.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# PyRadio Text-to-Speech Support
2+
3+
## Overview
4+
5+
**PyRadio** now features comprehensive Text-to-Speech (TTS) support, providing auditory feedback for an enhanced radio streaming experience. This intelligent system delivers contextual information about station navigation, playback status, and system events.
6+
7+
## Table of Contents
8+
9+
<!-- vim-markdown-toc Marked -->
10+
11+
* [Features](#features)
12+
* [Activation](#activation)
13+
* [Permanent Activation](#permanent-activation)
14+
* [Temporary Activation](#temporary-activation)
15+
* [Platform Implementation](#platform-implementation)
16+
* [Linux](#linux)
17+
* [Windows](#windows)
18+
* [macOS](#macos)
19+
* [Language Support](#language-support)
20+
* [Voice Characteristics](#voice-characteristics)
21+
* [Platform-Specific Strategy](#platform-specific-strategy)
22+
* [Technical Features](#technical-features)
23+
* [Smart Queue Management](#smart-queue-management)
24+
* [Intelligent Behavior](#intelligent-behavior)
25+
* [Usage Guidelines](#usage-guidelines)
26+
* [For English-Dominant Users](#for-english-dominant-users)
27+
* [For Multi-Language Content](#for-multi-language-content)
28+
* [Configuration Philosophy](#configuration-philosophy)
29+
* [Current Status & Roadmap](#current-status-&-roadmap)
30+
31+
<!-- vim-markdown-toc -->
32+
33+
[ [Return to main doc](index.md#text-to-speech-support) ]
34+
35+
## Features
36+
37+
The TTS system provides spoken feedback for:
38+
39+
- **Station Information**: Station names and numbers during navigation
40+
- **Playback Status**: Start of playback and connection establishment
41+
- **Media Context**: Song titles when available in stream metadata
42+
- **System Events**: Connection errors and important status changes
43+
- **Audio Control**: Volume adjustment feedback
44+
45+
## Activation
46+
47+
### Permanent Activation
48+
Enable TTS permanently through the configuration menu:
49+
**Config → TTS → Enable TTS**
50+
51+
### Temporary Activation
52+
Toggle TTS during runtime by pressing **\\T** (backslash + T). This setting is session-only and resets when restarting PyRadio.
53+
54+
## Platform Implementation
55+
56+
### Linux
57+
Utilizes **speech-dispatcher** configured for English language by default. Provides robust, interruptible speech synthesis with priority-based queue management.
58+
59+
### Windows
60+
Leverages **Windows SAPI (Speech API)** with automatic selection of English voices when available. Features immediate speech interruption and consistent volume control.
61+
62+
### macOS
63+
Employs the native **`say` command** using the system's default voice. Most macOS voices support multiple languages natively, handling mixed-language content seamlessly.
64+
65+
## Language Support
66+
67+
### Voice Characteristics
68+
69+
TTS voices generally fall into two categories:
70+
71+
**Monolingual Voices** (typical on Linux/Windows):
72+
73+
- Specialized in one language
74+
- System messages sound clear in English
75+
- **Non-English characters may be mispronounced or skipped entirely**
76+
77+
**Multilingual Voices** (common on macOS):
78+
79+
- Automatic language detection and switching
80+
- Handle mixed-language content naturally
81+
- Provide authentic pronunciation for both system messages and station names
82+
83+
### Platform-Specific Strategy
84+
85+
- **Linux**: English-configured for consistent system messaging
86+
- **Windows**: Auto-selects English voices while respecting system preferences
87+
- **macOS**: Uses default system voice - typically multilingual by design
88+
89+
## Technical Features
90+
91+
### Smart Queue Management
92+
- Priority-based processing (HIGH for alerts, NORMAL for navigation)
93+
- Pending title queuing after high-priority interruptions
94+
- Volume adjustment debouncing
95+
- Platform-optimized anti-stutter protection
96+
97+
### Intelligent Behavior
98+
- Critical alerts receive immediate priority
99+
- Song titles are queued and spoken after high-priority interruptions
100+
- Rapid navigation triggers queue optimization
101+
- Volume changes are consolidated to prevent speech spam
102+
103+
## Usage Guidelines
104+
105+
### For English-Dominant Users
106+
- Default configuration works optimally
107+
- System messages and international station names sound natural
108+
109+
### For Multi-Language Content
110+
- **macOS**: Handles mixed content seamlessly with multilingual voices
111+
- **Windows/Linux**: **Non-English characters in station names may not be pronounced correctly**
112+
- Consider using English names for frequently-accessed stations
113+
114+
## Configuration Philosophy
115+
116+
The system is optimized for English while respecting platform conventions:
117+
118+
- **English-optimized voice selection on Linux and Windows**
119+
- **Multilingual voice support on macOS**
120+
- Maintains your preferred speech rate and volume
121+
- Platform-native experience throughout
122+
123+
## Current Status & Roadmap
124+
125+
This TTS implementation is actively developed. Planned enhancements include:
126+
127+
- Comprehensive help system narration
128+
- Detailed interface element descriptions
129+
- Enhanced context-aware speech patterns
130+
- Extended configuration options
131+

pyradio/config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ use_station_icon = True
127127
remove_station_icons = True
128128

129129
# TTS
130+
# Enables PyRadio Text-to-Speech feature, provided that such a feature is
131+
# already supported by the system.
132+
#
130133
# Default value: False
131134
enable_tts = False
132135

0 commit comments

Comments
 (0)