plyer, kivy. dont understand this program. what changes must I do?

Question:

I’m new to plyer and kivy

I have this program:

import kivy
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.popup import Popup

from plyer import tts

kivy.require('1.8.0')





class Text2SpeechDemo(BoxLayout):
    def do_read(self):
        try:
            tts.speak(self.ids.notification_text.text)
        except NotImplementedError:
            popup = ErrorPopup()
            popup.open()


class Text2SpeechDemoApp(App):
    def build(self):
        return Text2SpeechDemo()

    def on_pause(self):
        return True


class ErrorPopup(Popup):
    pass




if __name__ == '__main__':
    Text2SpeechDemoApp().run()

When I run this program, it opens something (that doesn’t have a space to write or buttons). No error appears, it’s just wrong.
This is an example from the official github from plyer.

what do I have to do to make it read? and what will it read?
can some explain a bit of plyer?

edited:
added this file, but an error appears (image):

#:kivy 1.8.0
<Text2SpeechDemo>:
    BoxLayout:
        orientation: 'vertical'
        padding: 20

        TextInput:
            id: notification_text
            text: 'Put message here'
        
        Button:
            text: 'Read'
            size_hint_y: 0.2
            on_press: root.do_read()

<ErrorPopup>:
    size_hint: .7, .4
    title: "Error"
    
    BoxLayout:
        orientation: 'vertical'
        padding: 10
        spacing: 20

        Label:
            size_hint_y: 0.4
            text: "This feature has not yet been implemented in Plyer."
        Button:
            text: 'Dismiss'
            size_hint_y: 0.4
            on_press: root.dismiss()
            

enter image description here

Asked By: Habi

||

Answers:

plyr cannot do tts.speak

The source code shows it is not implemented

https://github.com/kivy/plyer/blob/master/plyer/facades/tts.py#L39

Answered By: OneCricketeer
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.