Created
June 25, 2012 15:28
-
-
Save tshirtman/2989272 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| from kivy.app import App | |
| from kivy.core.audio import SoundLoader | |
| from kivy.uix.floatlayout import FloatLayout | |
| from kivy.uix.slider import Slider | |
| from functools import partial | |
| def test(sound, *args): | |
| print args[1] | |
| sound.volume = args[1] | |
| class MyWidget(FloatLayout): | |
| def __init__(self): | |
| super(MyWidget, self).__init__() | |
| s = SoundLoader.load('/home/gabriel/Musique/coding music/01 - coding in c.mp3') | |
| slider = Slider(value=s.volume, min=0, max=1) | |
| s.play() | |
| slider.bind(value=partial(test, s)) | |
| self.add_widget(slider) | |
| class MyApp(App): | |
| def build(self): | |
| return MyWidget() | |
| if __name__ == '__main__': | |
| MyApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment