Files
Pynomicon/classes/utils/audio.py
2021-06-04 14:08:20 -04:00

22 lines
400 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 8 10:26:56 2021
@author: neal
"""
from os import system
from sys import platform
sound_args = ""
def play_sound(file):
if platform == "win32" or platform == "win64" or platform == "cygwin":
cmd = "wmplayer " + '"' + file + '"'
else:
cmd = "aplay -N " + sound_args + " " + file + " &"
# print(cmd)
system(cmd)