Update sox.py
This commit is contained in:
parent
145b84f9ed
commit
62630a06ac
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user