Created
August 14, 2015 02:00
-
-
Save stefania11/f54d2e407931a3556ab4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def say_with_music(text: 'Space is cool.', | |
music: MUSIC.sample, | |
voice: NONMUSICAL_VOICES.sample, | |
volume: 0.8) | |
cmd = "say -v #{voice} \"#{text}\""\ | |
" & sleep 3 && afplay -v #{volume} #{music} &" | |
system(cmd) | |
end | |
def kill_say | |
cmd = "kill -15 $(ps aux | pgrep -l say | egrep -o '\\d+') &> /dev/null" | |
system(cmd) | |
end | |
def kill_afplay | |
cmd = "kill -15 $(ps aux | pgrep -l afplay | egrep -o '\\d+') &> /dev/null" | |
system(cmd) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment