From 8640f6a11485062bbb4c720f57336c9bf0e425c5 Mon Sep 17 00:00:00 2001 From: Snorky Date: Thu, 19 Jun 2025 15:28:27 +0200 Subject: [PATCH] Change PATH constructor --- README.md | 2 +- recorder.py | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 300e875..26f43c1 100644 --- a/README.md +++ b/README.md @@ -96,4 +96,4 @@ Message transmitted is: HackThePlanet Il arrive certaines fois que le message ne se déchiffre pas. -Le problème n'est pas necore géré ... :) \ No newline at end of file +Le problème n'est pas encore géré ... :) \ No newline at end of file diff --git a/recorder.py b/recorder.py index 7c6fe09..26a8bcf 100755 --- a/recorder.py +++ b/recorder.py @@ -1,6 +1,5 @@ #!/usr/bin/env python - from pvrecorder import PvRecorder from pydub import AudioSegment from scipy.io import wavfile @@ -11,6 +10,7 @@ import sys, os import struct import wave +AUTHOR = "Snorky" VERSION = 0.1 def detect_frequency(file_path, duration=60): @@ -336,10 +336,11 @@ def welcome(): / _, _/ __/ /__/ /_/ / / / /_/ / __/ / /_/ |_|\___/\___/\____/_/ \__,_/\___/_/ - Author: Snorky + Author: {AUTHOR} Version : {VERSION} """) + def main(): welcome() @@ -348,9 +349,13 @@ def main(): showArgs(parser) verbosity = False - root_path = "/home/" + os.getlogin() + "/.cache/recorder" + """ root_path = "/home/" + os.getlogin() + "/.cache/recorder" tmp_dir_path = root_path + "/tmp" - wave_dir_path = root_path + "/wave" + wave_dir_path = root_path + "/wave" """ + + root_path = os.path.join(os.path.expanduser('~'), ".cache/recorder") + tmp_dir_path = os.path.join(root_path, "tmp") + wave_dir_path = os.path.join(root_path, "wave") checkEnv(root_path, tmp_dir_path, wave_dir_path) if args.show_devices: