Skip to content

Instantly share code, notes, and snippets.

@X-88
Created February 16, 2021 16:34
Show Gist options
  • Save X-88/f39d0d54d408a448255497b35a40904f to your computer and use it in GitHub Desktop.
Save X-88/f39d0d54d408a448255497b35a40904f to your computer and use it in GitHub Desktop.
Playing & Stop Music using Android Helper
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