#!/usr/bin/env python # #play_prerecorded_phrase.py # #Used by cron jobs to play a prerecordeed phrase# import os, subprocess, sys def play_file(audioFile, tempo=0.8): if (os.path.isfile(audioFile)): # use sox to play mp3 file and slow it down slightly subprocess.call('play ' + audioFile + ' -V1 -q tempo ' + str(tempo), shell=True) else: print('No File Found :' + audioFile) def main(): numArgs = len(sys.argv) if (numArgs == 2): play_file(sys.argv[1]) else: print(f'No Filename Specified') exit(0) if __name__ == '__main__': main()