Implemented platform specific stuff
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -1,5 +1,8 @@
|
||||
#!/usr/bin/env python3
|
||||
from typing import Optional
|
||||
from .abcsensor import AbcSensor
|
||||
from utils import config
|
||||
from birbnetes_iot_platform_raspberry import BirbnetesIoTPlatformRecordDriver
|
||||
|
||||
"""
|
||||
Sound sensor high level API
|
||||
@ -15,11 +18,17 @@ class SoundSensor(AbcSensor):
|
||||
"""
|
||||
SoundSensor class. Responsible for sound retrieval from any microphones present.
|
||||
"""
|
||||
def getvalue(self) -> str:
|
||||
|
||||
def __init__(self):
|
||||
BirbnetesIoTPlatformRecordDriver.init(config.SAMPLE_LENGTH)
|
||||
|
||||
def getvalue(self) -> Optional[str]:
|
||||
"""
|
||||
Retrieve a 5 second sound clip from a microphone.
|
||||
Retrieve a configurable length second sound clip from a microphone.
|
||||
:return:
|
||||
"""
|
||||
# Recieve sound from microphone and save it to a file on the filesystem.
|
||||
# Then return the filename
|
||||
return "filename.wav"
|
||||
return BirbnetesIoTPlatformRecordDriver.get_recording(False)
|
||||
|
||||
def __del__(self):
|
||||
# In theory you should not put anything to __del__ as it is not guaranteed to be called.
|
||||
BirbnetesIoTPlatformRecordDriver.cleanup()
|
||||
|
Reference in New Issue
Block a user