Update sox.py
This commit is contained in:
parent
145b84f9ed
commit
62630a06ac
@ -3,17 +3,24 @@ import subprocess
|
|||||||
|
|
||||||
class driver():
|
class driver():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.volume = 1.0;
|
self.proc = None
|
||||||
|
self.volume = 1.0
|
||||||
|
self.soundType = ''
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
return environment
|
return environment
|
||||||
def shutdown(self, environment):
|
def shutdown(self, environment):
|
||||||
return environment
|
return environment
|
||||||
def playFrequence(self, frequence, duration, adjustVolume):
|
def playFrequence(self, frequence, duration, adjustVolume):
|
||||||
pass
|
self.soundType = 'frequence'
|
||||||
def playSoundFile(self, filePath, interrupt = True):
|
def playSoundFile(self, filePath, interrupt = True):
|
||||||
|
if interrupt:
|
||||||
|
self.cancel()
|
||||||
self.proc = subprocess.Popen("play -q -v " + str(self.volume ) + ' ' + filePath, shell=True)
|
self.proc = subprocess.Popen("play -q -v " + str(self.volume ) + ' ' + filePath, shell=True)
|
||||||
|
self.soundType = 'file'
|
||||||
def cancel(self):
|
def cancel(self):
|
||||||
pass
|
if self.soundType == 'file':
|
||||||
|
self.proc.kill()
|
||||||
|
self.soundType = ''
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
def setVolume(self, volume):
|
def setVolume(self, volume):
|
||||||
|
Loading…
Reference in New Issue
Block a user