Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix problem #90

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions Client/Listener/audios_acquire.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion Client/Listener/start_pi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &
Expand Down
12 changes: 6 additions & 6 deletions Client/Listener/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading