Skip to content

Unable to record audio #834

Open
Open
@rcnn-retall

Description

@rcnn-retall

Software Versions

  • Python: 3.11.5
  • OS:Android
  • Kivy: 2.3.0
  • Kivy installation method: pip

Describe the bug
A clear and concise description of what the bug is.
Unable to record audio

The issue tracker is a tool to address bugs only (search known bugs: https://git.io/vM1iE).
Please use the #support Discord channel at https://chat.kivy.org/ or Stack Overflow for
support questions, more information at https://git.io/vM1yQ.

Expected behavior
A clear and concise description of what you expected to happen.
app error
To Reproduce
A short, runnable example that reproduces the issue with latest kivy master.

Code and Logs and screenshots

from plyer import audio
from kivy.uix.button import Button
from kivy.uix.screenmanager import Screen, ScreenManager
from kivy.app import App
from kivy.uix.label import Label


class MainApp(App):
    def __init__(self):
        super(MainApp, self).__init__()
        self.body = Screen()
        self.l1 = Label(text="Hello World", pos_hint={"top": 1}, size_hint=(1, None))
        self.l1.bind(texture_size=self.l1.setter("size"))

        self.body.add_widget(self.l1)

        self.body.add_widget(Button(text="strta", size_hint=(.5, .5), pos_hint={"x": 0, "center_y": .5}, on_press=self.start))
        self.body.add_widget(Button(text="end", size_hint=(.5, .5), pos_hint={"right":1,"center_y": .5}, on_press = self.stop))
        self.body.add_widget(Button(text="plyer", size_hint=(1, .25), on_press = self.ple))

    def build(self):
        return self.body
    def start(self, widget):

        try:
            audio.start()
        except Exception as e:
              # 桌面环境不需要权限
            self.l1.text = str(e)
            print(self.l1.text)



    def stop(self, widget):
        try:
            audio.stop()
        except Exception as e:
            self.l1.text = str(e)
    def ple(self, widget):
        try:
            audio.play()
        except Exception as e:
            self.l1.text = str(e)


MainApp().run()

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions