by pepep » Sat Jun 05, 2010 1:12 pm
by pepep
Sat Jun 05, 2010 1:12 pm
Well, readSound os wonderfull!
I modify lpose (now spose) to readSound every time it make a simple movement in a global one. The return value of readSound adds if it is greater than a certain umbral, to compose the total sound ... b.e. "hello" has a duration aprox 0.8 seconds, more or less the same than one step. Then, all the "hello" sound sums 200 b.e, but "wonderfull" sums more, b.e. 500.
With this procedure I can program class of sounds, and make diferents things with each class (walk forward, backward, turn, wait, ...).
I must control when the sound has finish, but I don't think was a problem reading until the readSound return a minor value ...
This is the new code:
- Code: Select all
(= snd 0)
(def spose (dur stp pos lpst)
(if (or pos)
( do (= lpst (.PlayPose wck dur stp (toByteArray (car pos)) false))
;(prn "nxt: " lpst)
(= snd (if (> (= sndt (readSound)) 40) (+ snd sndt) snd))
(if lpst (spose dur stp (cdr pos) false)
)
)
)
lpst
)
Do all this things all together haven't any delay in the robot movement! Great!
Some questions:
1. whats the diference between readSound and readMIC?
2. what do you want I test with runSound? In DC mode has no funtionality, no in the current DCM.lisp ...
cheers!
Well, readSound os wonderfull!
I modify lpose (now spose) to readSound every time it make a simple movement in a global one. The return value of readSound adds if it is greater than a certain umbral, to compose the total sound ... b.e. "hello" has a duration aprox 0.8 seconds, more or less the same than one step. Then, all the "hello" sound sums 200 b.e, but "wonderfull" sums more, b.e. 500.
With this procedure I can program class of sounds, and make diferents things with each class (walk forward, backward, turn, wait, ...).
I must control when the sound has finish, but I don't think was a problem reading until the readSound return a minor value ...
This is the new code:
- Code: Select all
(= snd 0)
(def spose (dur stp pos lpst)
(if (or pos)
( do (= lpst (.PlayPose wck dur stp (toByteArray (car pos)) false))
;(prn "nxt: " lpst)
(= snd (if (> (= sndt (readSound)) 40) (+ snd sndt) snd))
(if lpst (spose dur stp (cdr pos) false)
)
)
)
lpst
)
Do all this things all together haven't any delay in the robot movement! Great!
Some questions:
1. whats the diference between readSound and readMIC?
2. what do you want I test with runSound? In DC mode has no funtionality, no in the current DCM.lisp ...
cheers!