mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-14 11:04:23 -04:00
feat(examples): add example playing sointu tracks from Python (#108)
* Added Python code example. * Added pyinstaller build. * Clarified debugging steps in README.md. * Added linux implementation. * Cosmetics. * Updated README with correct steps.
This commit is contained in:
16
examples/code/Python/sointu_python/__main__.py
Normal file
16
examples/code/Python/sointu_python/__main__.py
Normal file
@ -0,0 +1,16 @@
|
||||
from sointu import (
|
||||
play_song,
|
||||
playback_position,
|
||||
playback_finished,
|
||||
sample_rate,
|
||||
track_length,
|
||||
)
|
||||
from sys import exit
|
||||
|
||||
if __name__ == '__main__':
|
||||
play_song()
|
||||
|
||||
while not playback_finished():
|
||||
print("Playback time:", playback_position() / sample_rate())
|
||||
|
||||
exit(0)
|
Reference in New Issue
Block a user