Created
February 16, 2021 16:34
-
-
Save X-88/f39d0d54d408a448255497b35a40904f to your computer and use it in GitHub Desktop.
Playing & Stop Music using Android Helper
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
import os, androidhelper | |
path = '/storage/emulated/0/sfx/test.mp3' | |
ah = androidhelper.Android() | |
def test(): | |
os.system('clear') | |
c = chr(ord(input('p = play, s = stop\n>>> '))) | |
if c == 'p': | |
ah.mediaPlay(path) | |
return test() | |
elif c == 's': | |
ah.mediaPlayClose() | |
else: | |
os.system('sleep 1') | |
os.system('clear') | |
return test() | |
test() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment