Merge pull request #142 from ysak-y/modify_audio_player_command_for_darwin

Modify audio playing command in play_audio() for Darwin
pull/170/head
Kris Gesling 2020-05-18 11:14:51 +09:30 committed by GitHub
commit ae0a9f9a05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -80,8 +80,10 @@ def play_audio(filename: str):
import platform
from subprocess import Popen
player = 'play' if platform.system() == 'Darwin' else 'aplay'
Popen([player, '-q', filename])
if platform.system() == 'Darwin':
Popen(['afplay', filename])
else:
Popen(['aplay', '-q', filename])
def activate_notify():