Files
Pynomicon/classes/utils/audio.py
2021-01-22 10:16:17 -05:00

23 lines
444 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 8 10:26:56 2021
@author: neal
"""
import os
from sys import platform as _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)
os.system(cmd)
#play_sound("../misc/boat-horn.wav")