sointu/examples/code/Python/sointu_python/__main__.py
Alexander Kraus 94589eb2eb
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.
2023-10-11 09:37:00 +03:00

17 lines
302 B
Python

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)