Commit ad170fb
A Sound category, and a Sound tab that proves your speakers work
Making a noise from Python meant installing something, and the usual
first choice, pyttsx3, says nothing at all until runAndWait is called.
So the honest answer to "why can I hear nothing" was rarely obvious.
Every computer already has a voice and a speaker; the trouble is that
each one is reached a different way. Windows has the voices behind
Narrator, macOS has say, Linux has espeak. The new Sound category hides
that difference behind twenty two blocks that work everywhere with
nothing installed: say out loud, start saying, set voice, set speaking
speed, save speech to a file, play note, play drum, play a frequency in
any of five wave shapes, tempo, rest, play and start a sound file, stop,
volume.
Tones, notes and drums are worked out one sample at a time and written
as real wav files, so there is no synthesiser to install either. Each
one is calculated once and kept, so a note inside a loop stays fast. The
voice dropdown lists the voices this computer really has, looked up in
the background so the window never waits for it.
The Sound tab on the right is where you go when nothing can be heard.
Test my speakers plays three notes and says so; if you hear nothing, the
mute switch or the output device is the culprit rather than your program.
Type a sentence, choose a voice, drag the speed and volume, press Say it.
Put these blocks in my project then drops blocks that do exactly what you
just heard. It runs the same helper functions the blocks compile to, so
the tab and your program can never drift apart.
For anyone who would rather use pyttsx3, gtts or playsound there are now
hand written blocks for those too, and the pyttsx3 ones always call
runAndWait.
Also here: the side strip gives its twelfth category room, the panel tabs
no longer clip, and the block drawer starts a little wider.
Version 1.5.0.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent eb2f530 commit ad170fb
4 files changed
Lines changed: 1126 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
150 | 201 | | |
151 | 202 | | |
152 | 203 | | |
| |||
357 | 408 | | |
358 | 409 | | |
359 | 410 | | |
360 | | - | |
| 411 | + | |
361 | 412 | | |
362 | 413 | | |
363 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
| |||
Loading
0 commit comments