Announcement

Collapse
No announcement yet.

Request for help with Text-to-Speech

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Request for help with Text-to-Speech

    I tried the concept text-to-speech program but was not able to get any sound out of either one of the two phones.

    I'll need to spend more time to try this out, but would much appreciate any experience others could offer.

    Our phones are the ones in the 2017 kit: 2 Moto G Play phones running Android 6.0.1.

    Do I need anything else to get this to work?

    Thank you and have a nice weekend.

  • #2
    This is what works for me:

    Code:
            TextToSpeech tts;
            tts = new TextToSpeech(hardwareMap.appContext, null);
            tts.setLanguage(Locale.US);
            tts.speak("Hello world", TextToSpeech.QUEUE_FLUSH, null);

    Comment


    • #3
      I am curious, where are you planning to use this? Is there a way to make text to speech work on DS e.g reading telemetry messages?

      Comment


      • #4
        I tried the concept text-to-speech program but was not able to get any sound out of either one of the two phones.
        I'll need to spend more time to try this out, but would much appreciate any experience others could offer.
        Our phones are the ones in the 2017 kit: 2 Moto G Play phones running Android 6.0.1.
        Do I need anything else to get this to work?
        In my experience it helps to insert a one-second delay using a Sleep block after using the AndroidTextToSpeech.Initialize block. You'll also want to make sure that the media sound volume is up on your Robot Controller phone. Here's a link to a Text to Speech Demonstration op mode as a Blocks BLK file: https://ortop.org/ftc/BlocksProgramming/SpeechDemo.blk
        You can download this file to your computer and then upload it to your blocks environment. If you have trouble downloading the file, use the following link and the scroll down to "Text to Speech Demonstration" and use a right click and select Save Link As or a similar menu option.
        You can use the following steps to upload a BLK file to the blocks environment:
        (1) Use the web browser on your computer to access the list of op mode programs on the RC phone.
        (2) Click on the Upload Op Mode button, select Choose File and browse to BLK file you previously downloaded to your computer. Select Open.

        Comment


        • #5
          I left out a link in my message above. This link leads to a list of sample op modes. Scroll to the end of the list to find the link to the Text to Speech Demonstration.
          https://ortop.org/ftc/ftc-team-resou...amming/#Sample

          Comment

          Working...
          X