Update sox.py

This commit is contained in:
chrys87 2016-09-16 12:50:07 +02:00 committed by GitHub
parent 145b84f9ed
commit 62630a06ac

View File

@ -3,17 +3,24 @@ import subprocess
class driver():
def __init__(self):
self.volume = 1.0;
self.proc = None
self.volume = 1.0
self.soundType = ''
def initialize(self, environment):
return environment
def shutdown(self, environment):
return environment
def playFrequence(self, frequence, duration, adjustVolume):
pass
self.soundType = 'frequence'
def playSoundFile(self, filePath, interrupt = True):
if interrupt:
self.cancel()
self.proc = subprocess.Popen("play -q -v " + str(self.volume ) + ' ' + filePath, shell=True)
self.soundType = 'file'
def cancel(self):
pass
if self.soundType == 'file':
self.proc.kill()
self.soundType = ''
def setCallback(self, callback):
pass
def setVolume(self, volume):