goldendict-ng
goldendict-ng copied to clipboard
"Auto-pronounce words in main window" not work
Version
- GoldenDict 24.01.22
- OS archlinux 20204.2.5
- Desktop KDE Plasma 5.27
- Dict 牛津高阶英汉双解词典(简体)第8版
Problem
- "Auto-pronounce words in main window" not work
Others
No problem for Qt 6.7 on Windows 11
Bot detected the issue body's language is not English, translate it automatically.
Version
- GoldenDict 24.01.22
- OS archlinux 20204.2.5
- Desktop KDE Plasma 5.27 *Dict Oxford Advanced Learner's Dictionary (Simplified) 8th Edition
Problem
- "Auto-pronounce words in main window" not work
Others
No problem on Windows 11
i had the same problem , they don't work to me
Need more information:
- manually play the first sound? does it work?
- change the audio engine to external player or ffmpeg, does it work?
- manually play the first sound? does it work?
Yes
- change the audio engine to external player or ffmpeg, does it work?
No
I guess the first found audio file by the gd-ng maybe broken.
try to rearrange the first few dictionaries' order
When using only one dict ("Dict 牛津高阶英汉双解词典(简体)第8版"), the problem still exists.
Bot detected the issue body's language is not English, translate it automatically.
When using only one dict ("Dict Oxford Advanced Learner's Dictionary (Simplified) 8th Edition"), the problem still exists.
- manually play the first sound? does it work?
Yes
- change the audio engine to external player or ffmpeg, does it work?
No
exactly the same here.
To solve this problem, create a file article-script.js
with the following content
window.addEventListener("load", () => {
setTimeout(() => {
window.location.href = gdAudioLinks.first;
}, 0);
});
and then put into the ~/.goldendict
folder.
To solve this problem, create a file
article-script.js
with the following contentwindow.addEventListener("load", () => { setTimeout(() => { window.location.href = gdAudioLinks.first; }, 0); });
and then put into the
~/.goldendict
folder.
I've put it in ~/.config/goldendict
, and it works.
However, before the audio playing, it takes a longer latency than when translating from clipboard (Ctrl+C, C).
The lag depends on your size of dictionaries, if you want to speed up, then you can try to change the time of wait (which is 300
is the example) before goldendict
is ready to pronounce:
setTimeout(() => {
window.location.href = gdAudioLinks.first;
}, 300);
And replace your file with the content above.
Warning: too small will stop goldendict
from working properly.
Another problem is that when translating from clipboard (Ctrl+C, C) it'll pronounce twice.
Another problem is that when translating from clipboard (Ctrl+C, C) it'll pronounce twice.
I cannot reproduce it on my device. Maybe it is because that I setup the shortcut in my sway
config instead of relying on goldendict
to register a global one.
In my practice, article-script.js
works regardless of the options below:
- Auto-pronounce words in main window
- Auto-pronounce words in scan popup
It just add an extra auto-pronounce.
Yes, exactly. Please thus turn them off.
@JingMatrix , thanks for the fix
I Had to modify the script in case no audio is found:
window.addEventListener("load", () => {
setTimeout(() =>
{
if (gdAudioLinks.first)
window.location.href = gdAudioLinks.first;
}, 0);
});