Skip to content

Instantly share code, notes, and snippets.

@wannaphong
Created September 15, 2018 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wannaphong/cf1bfcdced5f224eb790f084ff954ba6 to your computer and use it in GitHub Desktop.
Save wannaphong/cf1bfcdced5f224eb790f084ff954ba6 to your computer and use it in GitHub Desktop.
import sys
from subprocess import call
def play(name):
if sys.platform == 'linux':
call(["ffplay",name])
elif sys.platform == 'darwin':
call(["afplay",name])
elif sys.platform == 'win32':
call(['start',name])
else:
print('error : ',name)
play("ไฟล์.mp3")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment