Navigation

    MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    SOLVED MM and Kalliope: make Kalliope speaking

    Troubleshooting
    4
    14
    1485
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      NPX78 last edited by

      Hello everyone

      Sorry for my english.
      I hope my question is not already answered in another post

      I am working on module and interactions between Kalliope and MagicMirror.
      The module receives the order and takes it into account.

      Now, I would like to force Kalliope to say someting.

      For example:

      1. I say : “Kalliope … Display the calendar for John”
      2. Kalliope send a notification to modules
      3. My module catches this notification and display the calendar for John
      4. My module forces Kalliope to say “The calendera for John is displayed”

      The step 1, 2 a,d 3 are OK
      But I do not know if it is possible to do the step 4.

      Currently I display only the text.

      Thank you for your time and your help.

      Regards

      Nicolas

      S 1 Reply Last reply Reply Quote 0
      • N
        NPX78 last edited by

        :::

        Spoiler Text

        :::

        Hello

        So my solution.

        :::

        Kalliope Side :

        :::

        //-- settings.yml file
        
        # ---------------------------
        # Rest API
        # ---------------------------
        rest_api:
          active: True
          port: 5000
          password_protected: False
          login: admin
          password: secret
          allowed_cors_origin: "*" 
        
        

        active:True allows using the Rest API
        password_protected: False allows anonymous connections
        allowed_cors_origin: allows connections from other sites. This option is mandatory because the MM site is localhost:8080 and kalliope 127.0.0.1:5000

        Concerning the brain.yml file

          - name: "repeat"
            signals:
              - order: "repeat after me {{sentence}}"
            neurons:
              - say:
                  message: "{{sentence}}"
        
        

        This synapse allows Kalliope repeat a sentence.

        :::

        Magic Mirror side :

        :::

        The following lines could be inserted in a module file

        //-- Create the Request object.
        const Http   = new XMLHttpRequest();
        
        //-- Url to call fo our synapse.
        const url    = 'http://localhost:5000/synapses/start/id/repeat';
        
        //-- Build our data to send as parameters of our request.
        var sent     = 'This is the text I want Kalliope repeat';    //-- You can modify it
        var data     = {"parameters" : {'sentence':sent}};
        var dataJson = JSON.stringify(data);
        
        //-- Launch the request.                
        Http.open("POST",url);
        Http.setRequestHeader("Content-type","application/json");
        Http.send(dataJson);
        
        

        I hope to be clear 🙂
        I mark the post as Solved.

        Thank you a lot for your time and ideas.

        Regards

        Nicolas

        S 1 Reply Last reply Reply Quote 1
        • S
          sdetweil @NPX78 last edited by

          @npx78 maybe look at the MMM-TTS module (tts - Text To Speech) on github

          N 1 Reply Last reply Reply Quote 0
          • N
            NPX78 @sdetweil last edited by

            @sdetweil Thank you for your answer.
            In a perfect world, I would like to have the Kalliope voice :smiling_face_with_open_mouth_smiling_eyes:
            Is it possible with MMM-TTS module ?

            Regards

            Nicolas

            S 1 Reply Last reply Reply Quote 0
            • S
              sdetweil @NPX78 last edited by

              @npx78 i do not know

              1 Reply Last reply Reply Quote 0
              • Sean
                Sean Module Developer last edited by

                Consider MMM-GoogleTTS also.

                S 1 Reply Last reply Reply Quote 0
                • S
                  sdetweil @Sean last edited by

                  @sean oops… didn’t see that one!

                  1 Reply Last reply Reply Quote 0
                  • strawberry 3.141
                    strawberry 3.141 Project Sponsor Module Developer last edited by

                    @NPX78 MMM-TTS is an offline text to speech, where you can choose a few different voices, but I assume the voice of the Google module sounds better, but is online.

                    Here on the forum was once a member of the Kalliope team, you can reach out to him or on the kalliope project itself, if it needs to be that voice.

                    1 Reply Last reply Reply Quote 0
                    • Sean
                      Sean Module Developer last edited by Sean

                      @NPX78
                      After reading your question again, I have a little confusing.
                      As far as I know, Kalliope has its own TTS feature using pico2wave. And there be more options to use other TTS solution(including Google TTS). So I couldn’t understand why other MM TTS module is needed.

                      N 1 Reply Last reply Reply Quote 0
                      • N
                        NPX78 @Sean last edited by

                        @sean hello Sean.
                        Using the TTS of Kalliope could be the better solution.
                        But how can I call this fonctionnalité from a MM module

                        Thank you for your time and explanations

                        Regars

                        Nicolas

                        Sean 1 Reply Last reply Reply Quote 0
                        • Sean
                          Sean Module Developer @NPX78 last edited by Sean

                          @npx78
                          I have no experience with Kalliope so I’m not sure…
                          I think this is showing what you needs - https://kalliope-project.github.io/kalliope/rest_api/#run-a-synapse-from-an-order
                          So, by just calling Kalliope API with curl to run your reply synapse from your module after it’s job, couldn’t be done?

                          N 1 Reply Last reply Reply Quote 0
                          • 1
                          • 2
                          • 1 / 2
                          • First post
                            Last post
                          Enjoying MagicMirror? Please consider a donation!
                          MagicMirror created by Michael Teeuw.
                          Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                          This forum is using NodeBB as its core | Contributors
                          Contact | Privacy Policy