From fc36fc22a1aa56dd5d4a3c7f8aa98634eecad482 Mon Sep 17 00:00:00 2001 From: PascalSun Date: Mon, 29 Jul 2024 17:58:51 +0800 Subject: [PATCH] fix problem --- Client/Listener/audios_acquire.py | 26 +++++++++++++------------- Client/Listener/start_pi.sh | 2 +- Client/Listener/storage.py | 12 ++++++------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Client/Listener/audios_acquire.py b/Client/Listener/audios_acquire.py index 84b6c36c..7bfdd224 100644 --- a/Client/Listener/audios_acquire.py +++ b/Client/Listener/audios_acquire.py @@ -17,15 +17,15 @@ class AudioAcquire: def __init__( - self, - api_domain: str = "", - token: str = "", - home_id: Optional[str] = "", - energy_threshold: int = 5000, - default_microphone: str = "pulse", - record_timeout: int = 30000, - sampling_time: float = 0.25, - track_cluster: Optional[str] = None, + self, + api_domain: str = "", + token: str = "", + home_id: Optional[str] = "", + energy_threshold: int = 5000, + default_microphone: str = "pulse", + record_timeout: int = 30000, + sampling_time: float = 0.25, + track_cluster: Optional[str] = None, ): """ The audio acquire class @@ -131,9 +131,9 @@ def record_callback(_, audio: sr.AudioData) -> None: curr_audio_dir.mkdir(parents=True, exist_ok=True) with open( - curr_audio_dir - / f"{self.audio_index}-{sample_time.strftime('%Y%m%d%H%M%S')}.wav", - "wb", + curr_audio_dir + / f"{self.audio_index}-{sample_time.strftime('%Y%m%d%H%M%S')}.wav", + "wb", ) as file: file.write(wav_data) self.audio_index += 1 @@ -209,7 +209,7 @@ def main(): "--default_microphone", default="pulse", help="Default microphone name for SpeechRecognition. " - "Run this with 'list' to view available Microphones.", + "Run this with 'list' to view available Microphones.", type=str, ) parser.add_argument( diff --git a/Client/Listener/start_pi.sh b/Client/Listener/start_pi.sh index 0a633023..a72fc9f1 100755 --- a/Client/Listener/start_pi.sh +++ b/Client/Listener/start_pi.sh @@ -4,7 +4,7 @@ source venv/bin/activate export DISPLAY=:0.0 # Sync files process -nohup python3 storage.py --token c284262e850b8ac98e9174db620dc246ea6d9043 --api_domain http://192.168.50.113:8000 --dest_dir jarv5@192.168.50.113:/Users/jarv5/code/OpenOmniFramework/Client/Listener/data --dest_password jarv5 > sync_files.log 2>&1 & +nohup python3 storage.py --token c284262e850b8ac98e9174db620dc246ea6d9043 --api_domain http://192.168.50.113:8000 --dest_dir jarv5@192.168.50.113:/Users/jarv5/code/OpenOmniFramework/Client/Listener/ --dest_password jarv5 > sync_files.log 2>&1 & # Videos acquisition process nohup python3 videos_acquire.py --token c284262e850b8ac98e9174db620dc246ea6d9043 --api_domain http://192.168.50.113:8000 > videos_acquire.log 2>&1 & diff --git a/Client/Listener/storage.py b/Client/Listener/storage.py index cd2b387c..4f450e59 100644 --- a/Client/Listener/storage.py +++ b/Client/Listener/storage.py @@ -149,12 +149,12 @@ def on_any_event(self, event): class StorageHandler: def __init__( - self, - api_domain: str = "", - token: str = "", - home_id: int = None, - dest_dir: Optional[str] = None, - dest_password: Optional[str] = None, + self, + api_domain: str = "", + token: str = "", + home_id: int = None, + dest_dir: Optional[str] = None, + dest_password: Optional[str] = None, ): """ Args: