Python – Add audio files in kivy
Kivy is a platform independent GUI tool in Python. Kivy is a tool used to build cross-platform applications in Python which can run on android, IOS, Linux, Windows.
This module is used to load audio files in kivy.
from kivy.core.audio import SoundLoader
Below is the code on how you can import an audio file in kivy.
NOTE:You can import audio files with only ‘.wav’ format.
.kv file of the above code [Sample.kv]:
The output of the following code will be as shown below which will play an audio file ‘sampleaudio.wav’ when we click the play button.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course