Add mic function
This commit is contained in:
@@ -4,6 +4,7 @@ from smnp.library.function.display import display
|
||||
from smnp.library.function.exit import exit
|
||||
from smnp.library.function.flat import flat
|
||||
from smnp.library.function.interval import interval
|
||||
from smnp.library.function.mic import wait
|
||||
from smnp.library.function.semitones import semitones
|
||||
from smnp.library.function.sleep import sleep
|
||||
from smnp.library.function.type import objectType
|
||||
@@ -18,7 +19,8 @@ def createEnvironment():
|
||||
semitones,
|
||||
interval,
|
||||
combine,
|
||||
flat
|
||||
flat,
|
||||
wait
|
||||
]
|
||||
|
||||
methods = [
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
from smnp.library.model import CombinedFunction, Function
|
||||
from smnp.library.signature import signature, ofTypes
|
||||
from smnp.mic.detector.noise import NoiseDetector
|
||||
from smnp.type.model import Type
|
||||
|
||||
|
||||
def _wait1(env):
|
||||
nd = NoiseDetector()
|
||||
nd.waitForComplete()
|
||||
|
||||
|
||||
_sign1 = signature()
|
||||
|
||||
|
||||
def _wait2(env, noiseTreshold, silenceTreshold):
|
||||
nd = NoiseDetector(noiseTreshold.value, silenceTreshold.value)
|
||||
nd.waitForComplete()
|
||||
|
||||
|
||||
_sign2 = signature(ofTypes(Type.INTEGER), ofTypes(Type.INTEGER))
|
||||
|
||||
|
||||
wait = CombinedFunction(
|
||||
'wait',
|
||||
Function(_sign1, _wait1),
|
||||
Function(_sign2, _wait2)
|
||||
)
|
||||
|
||||
def wait(args, env):
|
||||
pass
|
||||
Reference in New Issue
Block a user