# Develop dictation skill

**URL:** https://community.openconversational.ai/t/develop-dictation-skill/8437
**Category:** Skills
**Created:** [April 7, 2020, 9:00am UTC](https://community.openconversational.ai/t/develop-dictation-skill/8437 "2020-04-07T09:00:24Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![luca-vercelli](https://community.openconversational.ai/letter_avatar_proxy/v4/letter/l/8edcca/32.png) [@luca-vercelli](https://community.openconversational.ai/u/luca-vercelli)
#### Post date: [April 7, 2020, 9:00am UTC](https://community.openconversational.ai/t/develop-dictation-skill/8437/1 "2020-04-07T09:00:25Z")

</div>

Hello.  
I am trying to develop a skill to be used on a PC.  
I want to dictate, and Mycroft should write the text in the currently opened application.

Basically, the skill should accept:

- a “start dictation” command, that enters some kind of “dictation mode”
- when in dictation mode, every spoken sentence should be directly sent to the “type” command
- a “stop dictation” command that exits dictation mode

Now, I cannot figure out how to handle such “dictation mode” with a Mycroft skill.

(P.S. maybe such skill does already exist?!?)

Thank you

---

<div class="post-metadata">

### Author: ![malevolent](https://community.openconversational.ai/user_avatar/community.openconversational.ai/malevolent/32/135_2.png) [@malevolent](https://community.openconversational.ai/u/malevolent)
#### Post date: [April 7, 2020, 10:29am UTC](https://community.openconversational.ai/t/develop-dictation-skill/8437/2 "2020-04-07T10:29:17Z")

</div>

I have been following this purpose since years now. The fact is Mycroft stops “hearing” if there is a significative pause, so we need to find a way to do it properly. Besides that difficulty, I don’t really know how can Mycroft can entirely replace the keyboard and “be aware” in which application it needs to behave as a keyboard (libreoffice document, notepad, or a simple textbox on any application), I guess that will be very difficult and you’ll need to go deep into each desktop environment to obtain where the cursor is focused at that moment.

@JarbasAl did years ago a [dictation-skill](https://github.com/JarbasAl/skill-dictation) (deprecated, not for use, not maintained and unsupported, so no need to ask him for help as he stated this skill is not for use), but you can take a look into it if you want some inspiration.

[I did rummaged with pyUNO](https://community.openconversational.ai/t/productivity-document-writting/3642), the Open|LibreOffice API, and perhaps we can do something in this way, just with the libreoffice|openoffice suite.

I’m very interested in this subject, but I think this is a very big project, and if it is even possible, you’ll need the help from the Mycroft devs themselves, for the reasons I said before.

---

<div class="post-metadata">

### Author: ![luca-vercelli](https://community.openconversational.ai/letter_avatar_proxy/v4/letter/l/8edcca/32.png) [@luca-vercelli](https://community.openconversational.ai/u/luca-vercelli)
#### Post date: [April 7, 2020, 1:47pm UTC](https://community.openconversational.ai/t/develop-dictation-skill/8437/3 "2020-04-07T13:47:18Z")

</div>

> [@malevolent](#):
>
> I don’t really know how can Mycroft can entirely replace the keyboard and “be aware” in which application it needs to behave as a keyboard

Ok, I think this could be a second step. In first instance, I would be happy to open myself the right program (e.g. libreoffice) and then dictate to Mycroft, and the latter may just send text to the active application (the Linux “type” program does exactly this, if I am not wrong).

---

<div class="post-metadata">

### Author: ![luca-vercelli](https://community.openconversational.ai/letter_avatar_proxy/v4/letter/l/8edcca/32.png) [@luca-vercelli](https://community.openconversational.ai/u/luca-vercelli)
#### Post date: [April 7, 2020, 2:53pm UTC](https://community.openconversational.ai/t/develop-dictation-skill/8437/4 "2020-04-07T14:53:36Z")

</div>

Sory the command is “xvkbd”, not “type”. (Just to say, “type” was the alias used by LiSpeak).

---

<div class="post-metadata">

### Author: ![malevolent](https://community.openconversational.ai/user_avatar/community.openconversational.ai/malevolent/32/135_2.png) [@malevolent](https://community.openconversational.ai/u/malevolent)
#### Post date: [April 9, 2020, 9:34am UTC](https://community.openconversational.ai/t/develop-dictation-skill/8437/5 "2020-04-09T09:34:49Z")

</div>

That could be an approach. Another to obtain cursor position could be xdotool, like for example `watch -n0.1 xdotool getmouselocation` , or perhaps there is a way with dbus, I ignore that.

---

<div class="post-metadata">

### Author: ![andlo](https://community.openconversational.ai/user_avatar/community.openconversational.ai/andlo/32/860_2.png) [@andlo](https://community.openconversational.ai/u/andlo)
#### Post date: [April 9, 2020, 10:01am UTC](https://community.openconversational.ai/t/develop-dictation-skill/8437/6 "2020-04-09T10:01:56Z")

</div>

I like this idea for at desktop skill. I would recomend looking at screen keyboards and how this is used and let mycroft act as a keyboard.  
The screen keyboards are well aware when user is in a typing area and pops up. Same could mycroft do - when user is in a typing areaa he could be readdy for dictation.

---

<div class="post-metadata">

### Author: ![JarbasAl](https://community.openconversational.ai/user_avatar/community.openconversational.ai/jarbasal/32/1319_2.png) [@JarbasAl](https://community.openconversational.ai/u/JarbasAl)
#### Post date: [April 9, 2020, 10:03am UTC](https://community.openconversational.ai/t/develop-dictation-skill/8437/7 "2020-04-09T10:03:17Z")

</div>

fairly easy to do… i might give it a spin if i have some free time

---

<div class="post-metadata">

### Author: ![luca-vercelli](https://community.openconversational.ai/letter_avatar_proxy/v4/letter/l/8edcca/32.png) [@luca-vercelli](https://community.openconversational.ai/u/luca-vercelli)
#### Post date: [April 9, 2020, 10:13am UTC](https://community.openconversational.ai/t/develop-dictation-skill/8437/8 "2020-04-09T10:13:19Z")

</div>

If you want some starting point, I have created a repo here:

> **[luca-vercelli/dictat-skill](https://github.com/luca-vercelli/dictat-skill)**
>
> Dictate text to the currently opened window (intended for use on pc) - luca-vercelli/dictat-skill

  
As @malevolent wrote, it is not that easy at it seems.

---

<div class="post-metadata">

### Author: ![JarbasAl](https://community.openconversational.ai/user_avatar/community.openconversational.ai/jarbasal/32/1319_2.png) [@JarbasAl](https://community.openconversational.ai/u/JarbasAl)
#### Post date: [April 9, 2020, 10:19am UTC](https://community.openconversational.ai/t/develop-dictation-skill/8437/9 "2020-04-09T10:19:29Z")

</div>

i dont think it makes sense to use the CommonPlay framework here…

check my super old implementation using converse method [https://github.com/JarbasAl/skill-dictation](https://github.com/JarbasAl/skill-dictation)

---

<div class="post-metadata">

### Author: ![luca-vercelli](https://community.openconversational.ai/letter_avatar_proxy/v4/letter/l/8edcca/32.png) [@luca-vercelli](https://community.openconversational.ai/u/luca-vercelli)
#### Post date: [April 9, 2020, 10:24am UTC](https://community.openconversational.ai/t/develop-dictation-skill/8437/10 "2020-04-09T10:24:34Z")

</div>

CommonPlay was just a trick to handle a problem with the sentence “Start dictating”… probably it’s not needed.

---

<div class="post-metadata">

### Author: ![malevolent](https://community.openconversational.ai/user_avatar/community.openconversational.ai/malevolent/32/135_2.png) [@malevolent](https://community.openconversational.ai/u/malevolent)
#### Post date: [April 14, 2020, 2:50pm UTC](https://community.openconversational.ai/t/develop-dictation-skill/8437/11 "2020-04-14T14:50:11Z")

</div>

Your TODO list must be really huge xD

I would use this voice helper _a lot_ as I’m becoming lazier with the years. Having a voice assistant for writing would boost Mycroft usage in the desktop/bigscreen.
