# Forvo .DSL to Forvo .MDX (Conversion instructions)

**URL:** <https://forum.freemdict.com/t/topic/22819>\
**Category:** 技术交流与词典编修\
**Tags:** mdx\
**Created:** [2023 年8 月 18 日 22:16 UTC](https://forum.freemdict.com/t/topic/22819 "2023-08-18T22:16:26Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

作者： ![Shuibogo](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/shuibogo/32/50505_2.png) [@Shuibogo](https://forum.freemdict.com/u/Shuibogo)\
发布日期： [2023 年8 月 18 日 22:16 UTC](https://forum.freemdict.com/t/topic/22819/1 "2023-08-18T22:16:26Z")

</div>

**Forvo Audios Conversion (.dsl → .mdx)**

**INSTRUCTIONS (Linux users)**

You can find the Forvo audios and ready .dsl dictionaries for them here:

> [@FORVO Pronunciations in All Languages (\>6.7 million)](https://forum.freemdict.com/t/topic/11947):
>
> Pronunciations from [Forvo.com](http://Forvo.com) Number of audios: \> 6.7 million Number of languages: 357 Format: .opus and .mp3 License: [CC BY-NC-SA 3.0](https://en.wikipedia.org/wiki/Forvo) Description: All Forvo audios from 2008 until 2021. All lang…

**1. Create a folder (lets call it “Forvo folder”) with:**

• Forvo audios for the target language (uncompressed) inside an “audio” folder. For french, for instance, the path should look like this:

> …/Forvo folder/audio/fr/{forvo usernames}/…

• .dsl file for your language  
• forvo\_{language}.txt (blank file)  
• title.html (just open it and write the name you want to be displayed for your dictionary  
• description.html (you can add a description for the dictionary or leave this file blank)

**2. Download this [Pyglossary](https://github.com/ilius/pyglossary) version with OctopusMdictSource support (attached below)**

[Pyglossary 4.6.1 (with MDX support).zip](https://forum.freemdict.com/uploads/short-url/bLcCywkxxpW0NdJmdtOQt0veMoe.zip) (896.1 KB)

Also install a interface:  
• Tkinter-based interface

```
**Debian/Ubuntu:** apt-get install python3-tk tix
**openSUSE:** zypper install python3-tk tix
**Fedora:** yum install python3-tkinter tix
**Mac OS X:** read https://www.python.org/download/mac/tcltk/
**Nix / NixOS:** nix-shell -p python38Packages.tkinter tix

```

• Gtk3-based interface

```
**Debian/Ubuntu:** apt install python3-gi python3-gi-cairo gir1.2-gtk-3.0
**openSUSE:** zypper install python3-gobject gtk3
**Fedora:** dnf install pygobject3 python3-gobject gtk3
**ArchLinux:**
    pacman -S python-gobject gtk3
    https://aur.archlinux.org/packages/pyglossary/
**Mac OS X** : brew install pygobject3 gtk+3
**Nix / NixOS:** nix-shell -p pkgs.gobject-introspection python38Packages.pygobject3 python38Packages.pycairo

```

If you already have some version of Pyglossary installed, you can just add the OctopusMdictSource plugin (attached below) to …/Pyglossary\_folder/pyglossary/plugins

[octopus\_mdict\_source.py](https://forum.freemdict.com/uploads/short-url/1XeVlBydCj7nyHpPPcuaiM4y37K.py) (4.7 KB)

**3. Install [mdict-utils](https://github.com/liuyug/mdict-utils)**

> pip install mdict-utils  
> or  
> pip3 install mdict-utils

1. Open your terminal, go to the Pyglossary folder and open the application

> python3 pyglossary.pyw

The Pyglossary UI should open

1. For the input file field, **select the .dsl file in the Forvo folder**. The input format is **ABBYY Lingvo (.dsl)**  
For the output field, **select the .txt file in the Forvo folder.** The format is **Octopus Mdict Source**

2. The .mdx source for the .dsl was generated. Now you have to **manually fix the paths to the audio files. Using a text editor and regular expressions [RegEx] (i use the Kate text editor), open your “forvo\_{language}.txt”**:

• FIND: \[s\]  
• REPLACE: \<a href="sound://

• FIND: //{language\_code}/(.\*?)/(.\*?).opus\[/s\]  
• REPLACE: //{language\_code}/\1/\2.opus"\>\2\</a\>

Instead of {language\_code} you should use the code for your language, like “fr” for french or “ru” for russian, just like the name of the zip file with the audios

**7. [OPTIONAL] you can link a .css to it, so that further customization is possible**

• FIND: \<div style=(.\*)  
• REPLACE: \<link rel=“stylesheet” type=“text/css” href=“style.css” /\>\n\<div style=\1

It may take like a minute or so to apply the changes  
If you are going to do this, create “style.css” inside the Forvo folder

Before the final step, your Forvo folder should look something like this:

 ![photo_2023-08-18_19-11-00](https://forumcdn.freemdict.com/uploads/default/original/3X/9/b/9b4d8c721d99913095b76d8fedeee812dbe1ae4c.jpeg)

**8. Now you just have to compile the .mdx and the .mdd using mdict-utils**

**• COMPILING THE .MDX**  
Open your terminal inside the Forvo folder and type:

> mdict --title title.html --description description.html -a forvo\_{language}.txt forvo\_{language}.mdx

**• COMPILING THE .MDD**

> mdict --title title.html --description description.html -a audio forvo\_{language}.mdd

Now you can delete everything, except the .mdx, the .mdd and the .css

You can rename the .mdx and the .mdd as you wish, and also add a icon (.png/.jpg, etc.), but be sure .mdx, .mdd and icon have the same name

**WARNING:** if you want to customize the dictionary using the .css, don’t ever rename it. The .css name is already specified within the compiled .mdx file

* * *

Of course the ideal would be creating a script to automate this whole process, but unfortunately I’m not a programmer and have little experience creating python scripts.

I’m not a Windows user so I can’t say much about the process there, but both Pyglossary and mdict-utils are available there.  
For Windows, you can alternatively use MDX Builder instead of mdict-utils, but honestly I think mdict-utils is much better and faster

These instructions are for the .opus audio files. If you want to use .mp3 audio, just replace .opus with .mp3 in the RegEx steps and use the .mp3 audio folder. I don’t see any reason for doing this. since the .opus files are high quality and take much less space.

**RegEx notes:**

• on Kate, \1, \2, … are used to paste what was captured with (.\*?) or (.\*) in the “FIND” field, following the order respectively. (.\*?) is a non-greedy capture group

• On Linux, \n is used for linebreaks, but I heard you should use \r\n on Windows

* * *

Following these same guidelines, I made Forvo French (MDX) and Forvo Persian (MDX):

 ![photo_2023-08-18_19-38-03](https://forumcdn.freemdict.com/uploads/default/original/3X/5/9/59dafa36713d19df6cc9326f464ebc56b8955848.jpeg)

• Link to the Forvo Persian (MDX): [https://cloud.freemdict.com/index.php/s/M7BzW2PAWDBF5k8](https://cloud.freemdict.com/index.php/s/M7BzW2PAWDBF5k8)

• Link to the Forvo French (MDX): [https://cloud.freemdict.com/index.php/s/8my4FYLCcGm2yed](https://cloud.freemdict.com/index.php/s/8my4FYLCcGm2yed)

---

<div class="post-metadata">

作者： ![tovaremeterio](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/tovaremeterio/32/15709_2.png) [@tovaremeterio](https://forum.freemdict.com/u/tovaremeterio)\
发布日期： [2023 年8 月 19 日 09:41 UTC](https://forum.freemdict.com/t/topic/22819/2 "2023-08-19T09:41:15Z")

</div>

Thank you very much ! Great job ! You are really kind… I hope more people would be able to create their favorite Pronunciation Dictionaries…!

---

<div class="post-metadata">

作者： ![Ambulante](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@Ambulante](https://forum.freemdict.com/u/Ambulante)\
发布日期： [2024 年9 月 8 日 16:27 UTC](https://forum.freemdict.com/t/topic/22819/3 "2024-09-08T16:27:22Z")

</div>

That’s really great job. Thanks for sharing this tutorial. I wish to know if it is possible to insert these audio files to a French (or any other language) dictionary? If I can combine the original dictionary with the pronunciation, it will be fantastic.

---

<div class="post-metadata">

作者： ![duomham](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/d/a4c791/32.png) [@duomham](https://forum.freemdict.com/u/duomham)\
发布日期： [2025 年1 月 19 日 16:16 UTC](https://forum.freemdict.com/t/topic/22819/4 "2025-01-19T16:16:02Z")

</div>

Is there a chance to help converting a dictionary from mdx mdd to Abbyy dsl, dsl.files.zip that I can use it with goldendict mobile. I do not have coding experience but general understand of python. Thanks in advance.

---

<div class="post-metadata">

作者： ![Wankata](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/w/a88e4f/32.png) [@Wankata](https://forum.freemdict.com/u/Wankata)\
发布日期： [2025 年1 月 19 日 18:00 UTC](https://forum.freemdict.com/t/topic/22819/5 "2025-01-19T18:00:25Z")

</div>

Try this: [Releases · glowinthedark/pyglossary · GitHub](https://github.com/glowinthedark/pyglossary/releases)

---

<div class="post-metadata">

作者： ![duomham](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/d/a4c791/32.png) [@duomham](https://forum.freemdict.com/u/duomham)\
发布日期： [2025 年1 月 19 日 18:11 UTC](https://forum.freemdict.com/t/topic/22819/6 "2025-01-19T18:11:54Z")

</div>

Thanks for replay  
I got this error  
Traceback (most recent call last):  
File “C:\PROGRA~1\PYGLOS~1\pyglossary\ui\ui\_tk.py”, line 182, in CallWrapper\_\_call\_\_  
File “C:\PROGRA~1\PYGLOS~1\pyglossary\ui\ui\_tk.py”, line 1452, in convert  
File “C:\PROGRA~1\PYGLOS~1\pyglossary\glossary\_v2.py”, line 1272, in convert  
File “C:\PROGRA~1\PYGLOS~1\pyglossary\glossary\_v2.py”, line 1221, in convertV2  
File “C:\PROGRA~1\PYGLOS~1\pyglossary\glossary\_v2.py”, line 1168, in \_convertPrepare  
File “C:\PROGRA~1\PYGLOS~1\pyglossary\glossary\_v2.py”, line 1090, in \_resolveSortParams  
File “C:\PROGRA~1\PYGLOS~1\pyglossary\glossary\_v2.py”, line 1006, in \_switchToSQLite  
File “C:\PROGRA~1\PYGLOS~1\pyglossary\sq\_entry\_list.py”, line 55, in **init**  
sqlite3.OperationalError: unable to open database file

---

<div class="post-metadata">

作者： ![Wankata](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/w/a88e4f/32.png) [@Wankata](https://forum.freemdict.com/u/Wankata)\
发布日期： [2025 年1 月 19 日 18:22 UTC](https://forum.freemdict.com/t/topic/22819/7 "2025-01-19T18:22:06Z")

</div>

Then try this way:

[怎样把dsl文件转换为mdx文件How to convert DSL files to MDX files](https://forum.freemdict.com/t/topic/35994) (you can convert not only in MDX, but in another format too).

---

<div class="post-metadata">

作者： ![duomham](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/d/a4c791/32.png) [@duomham](https://forum.freemdict.com/u/duomham)\
发布日期： [2025 年1 月 19 日 19:14 UTC](https://forum.freemdict.com/t/topic/22819/8 "2025-01-19T19:14:05Z")

</div>

Thanks Wankata.  
I ll try this, I really appreciate your help.

---

<div class="post-metadata">

作者： ![Wankata](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/w/a88e4f/32.png) [@Wankata](https://forum.freemdict.com/u/Wankata)\
发布日期： [2025 年1 月 19 日 19:26 UTC](https://forum.freemdict.com/t/topic/22819/9 "2025-01-19T19:26:49Z")

</div>

Convert to StarDict .IFO, it’s easier. I think, GoldenDict Mobile can handle this format.

---

<div class="post-metadata">

作者： ![duomham](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/d/a4c791/32.png) [@duomham](https://forum.freemdict.com/u/duomham)\
发布日期： [2025 年1 月 19 日 20:33 UTC](https://forum.freemdict.com/t/topic/22819/10 "2025-01-19T20:33:10Z")

</div>

I ll try, thanks a million. God bless you.

---

<div class="post-metadata">

作者： ![Ambulante](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@Ambulante](https://forum.freemdict.com/u/Ambulante)\
发布日期： [2025 年2 月 1 日 11:42 UTC](https://forum.freemdict.com/t/topic/22819/11 "2025-02-01T11:42:09Z")

</div>

Following my previous reply, I haven’t been able to insert the audio files to another dictionary. However, I managed to make an improved CSS in return.  
[style.css](https://forum.freemdict.com/uploads/short-url/jfXmIk7520PR0xMih2PDyrfvr1P.css) (1.1 KB)

---

<div class="post-metadata">

作者： ![BINGE](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/b/3d9bf3/32.png) [@BINGE](https://forum.freemdict.com/u/BINGE)\
发布日期： [2026 年4 月 18 日 15:54 UTC](https://forum.freemdict.com/t/topic/22819/12 "2026-04-18T15:54:39Z")

</div>

I need your help , could you make a Forvo Thai pronunciation in mdx and mdd ?

---

<div class="post-metadata">

作者： ![Savings4556](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/c4cdca/32.png) [@Savings4556](https://forum.freemdict.com/u/Savings4556)\
发布日期： [2026 年5 月 14 日 19:54 UTC](https://forum.freemdict.com/t/topic/22819/13 "2026-05-14T19:54:38Z")

</div>

I don’t know why but my dict doesn’t make a sound when I click it…
