A
A
amimamoya2021-01-19 17:27:49
Python
amimamoya, 2021-01-19 17:27:49

Music is played in kivy on PC, but not on adroid after compilation. What is the problem?

There is this elementary code:

Builder.load_string('''
<Start>:
    FloatLayout:
        Button:
            text: 'Включить'
            size_hint_x: .05
            size_hint_y: .08
            pos_hint:{'center_x': .5, 'y': .8}
            on_release: root.enable()
''')

class Start(Screen):
    def enable(self):
        sound = SoundLoader.load('Music/music.mp3')
        sound.play()

sm = ScreenManager(transition = NoTransition())
sm.add_widget(Start(name = 'one'))

class MyApp(App):  
    def build(self):
        return sm
        
MyApp().run()

Everything works as expected, when you click on the button, the music is played, but after compiling to android using buildozer, nothing is played. The path is correct, I'm sure of it, I didn't forget to specify the .mp3 format in the .spec file, what could be the problem I have no idea. I'm counting on you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question