Cleaning up.
This commit is contained in:
parent
dd23dbcd1f
commit
f805379385
2 changed files with 2 additions and 6 deletions
|
@ -212,10 +212,6 @@ def record_sound(hal: PizzaHAL, filename: Any, duration: int,
|
||||||
sd.stop()
|
sd.stop()
|
||||||
else:
|
else:
|
||||||
sd.wait() # Wait until recording is finished
|
sd.wait() # Wait until recording is finished
|
||||||
# TODO test
|
|
||||||
# myrecording = np.int16(myrecording)
|
|
||||||
# song = pydub.AudioSegment(myrecording.tobytes(), frame_rate=AUDIO_REC_SR, sample_width=2, channels=2)
|
|
||||||
# song.export(str(filename), format="mp3", bitrate="44.1k")
|
|
||||||
writewav(str(filename), AUDIO_REC_SR, myrecording)
|
writewav(str(filename), AUDIO_REC_SR, myrecording)
|
||||||
if cache:
|
if cache:
|
||||||
hal.soundcache[str(filename)] = (myrecording, AUDIO_REC_SR)
|
hal.soundcache[str(filename)] = (myrecording, AUDIO_REC_SR)
|
||||||
|
|
|
@ -193,8 +193,8 @@ class Statemachine:
|
||||||
Activity.TAKE_PHOTO: take_photo,
|
Activity.TAKE_PHOTO: take_photo,
|
||||||
Activity.LIGHT_LAYER: light_layer,
|
Activity.LIGHT_LAYER: light_layer,
|
||||||
Activity.LIGHT_BACK: backlight,
|
Activity.LIGHT_BACK: backlight,
|
||||||
Activity.ADVANCE_UP: move_vert,
|
# Activity.ADVANCE_UP: move_vert,
|
||||||
Activity.ADVANCE_LEFT: move_hor
|
# Activity.ADVANCE_LEFT: move_hor
|
||||||
}[act.activity](self.hal, **act.values)
|
}[act.activity](self.hal, **act.values)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
logger.exception('Caught KeyError, ignoring...')
|
logger.exception('Caught KeyError, ignoring...')
|
||||||
|
|
Loading…
Reference in a new issue