I run a simple Kivy app on Windows. A button executes following method from the Kivy docs (link) when pressed:
def play_audio(self):
sound = SoundLoader.load('output.wav')
if sound:
print("Sound found at %s" % sound.source)
print("Sound is %.3f seconds" % sound.length)
sound.play()
The first time the button is pressed, it either plays about half a second of sound and then immediately stops or it's not playing anything at all. When I press the button again it plays the entire file as expected.
Why isn't it playing the file on the first button press and how do I get it to work properly?
Any help is greatly appreciated.