Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Skill: CLI-Command-Skill #1341

Open
auwsom opened this issue Jun 7, 2020 · 5 comments
Open

New Skill: CLI-Command-Skill #1341

auwsom opened this issue Jun 7, 2020 · 5 comments

Comments

@auwsom
Copy link

auwsom commented Jun 7, 2020

Moved from here: MycroftAI/mycroft-core#2600

from mycroft import MycroftSkill, intent_file_handler
import subprocess

class SealEyeCommand(MycroftSkill):
    def __init__(self):
        MycroftSkill.__init__(self)

    @intent_file_handler('command.cli.intent')
    def handle_testa(self, message):
        utterance = message.data.get('utterance')
        if not ' '  in utterance:  
            self.speak('please say your command')
            return True
        commandL = utterance.split(' ', 1)
        #self.log.info("commandList: "+str(commandL))
        command = utterance.split(' ', 1)[1]
        #self.log.info("command: "+str(command))
        process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
        output, error = process.communicate()
        output = output.decode('UTF-8')
        self.log.info("Output: "+str(output))
        self.log.info("Error: "+str(error))
        self.speak(str(output))

def create_skill():
    return SealEyeCommand()
@auwsom
Copy link
Author

auwsom commented Jun 7, 2020

How would I add custom trigger words such as 'CLI' to the speech recognizer? Is there a way to build simple acryonyms or short words from phonemes as in the hotword PocketSphinx formulation?

@krisgesling
Copy link
Contributor

krisgesling commented Jun 8, 2020

Hey auwsom, the speech-to-text we currently use is Google (explanation here) so there's no way for us to change how these are transcribed unfortunately.

The work around as you've found is to see what gets transcribed and include those in your intent handler. This does get confusing in the translate platform when people wonder what you are doing with "seal eyes" but until we can get DeepSpeech up to production grade it's a hard limitation.

In terms of submitting Skills, this may be in another thread already but have you seen the docs section on how to submit Skills to the Marketplace?

If you don't have the mycroft-msk command available, you can manually activate the virtual environment and just run msk

source ~/mycroft-core/.venv/bin/activate
msk submit /opt/mycroft/skills/your-skill

@auwsom
Copy link
Author

auwsom commented Jun 8, 2020

@krisgesling , thanks, that helps.. Im actually using Mimic locally, so I figured there would be a way to customize it. But maybe I shouldnt do that if I plan on using the Android app. It still seems there should be some at least 'hacky' ways to build up from single syllables. Maybe shortening the recognition time (and accuracy) to decrease the pausing between single letters..

Anyway, thanks for the quicky version of how to submit. I expected it to be much more involved.

PS, I mentioned this in another thread, but it would be great to sort the skills in the marketplace by 'popularity'. Maybe on the number of stars in GitHub. This would really help promote useful skills faster and let the undeveloped or old ones stop cluttering the others (which I would worry about when adding too many skills). There was already a suggestion to combine desktop skills into some kind of suite: #1343 (comment)

@krisgesling
Copy link
Contributor

No worries.

To clarify, Mimic is Text-to-speech, not speech-recognition.

Agree on Marketplace. We want to add in some different ways to display, popularity would be a great one, and maybe "desktop" needs to be a category?

@auwsom
Copy link
Author

auwsom commented Jun 8, 2020

Re Mimic: Oh, right, it is. So then the offline local mycroft is using Google's DeepSpeech, interesting. So it just uses PocketSphinx (or Precise) for the hotword detection.. DeepSpeech does work really well, but doesnt PocketSphinx do speech rec too?

In the Marketplace, having the categories selectable in the sidebar like GMail labels would be helpful also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants