From 4543c8a48c09711909db8026da6c599f39100348 Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Wed, 11 Feb 2026 19:58:40 +0530 Subject: [PATCH] chore: Cleaned up code --- main.py | 6 ------ narrate.py | 24 ------------------------ wayland_narrate.py | 2 ++ 3 files changed, 2 insertions(+), 30 deletions(-) delete mode 100644 main.py delete mode 100644 narrate.py diff --git a/main.py b/main.py deleted file mode 100644 index d99aaa7..0000000 --- a/main.py +++ /dev/null @@ -1,6 +0,0 @@ -def main(): - print("Hello from kokoro-tts!") - - -if __name__ == "__main__": - main() diff --git a/narrate.py b/narrate.py deleted file mode 100644 index 8f1c3d9..0000000 --- a/narrate.py +++ /dev/null @@ -1,24 +0,0 @@ -import sounddevice as sd -from kokoro import KPipeline -import torch - -# Check if we are actually using your RTX 3050 -device = "cuda" if torch.cuda.is_available() else "cpu" -print(f"Using device: {device}") - -# Initialize pipeline with the specific Python 3.12 environment -pipeline = KPipeline(lang_code="a", device=device) - -text = """ -The RTX 3050 is now narrating this documentation. -Using uv and Python 3.12 ensures that we avoid the build errors -commonly found on Arch Linux's bleeding-edge Python 3.14. -""" - -# Generating audio -generator = pipeline(text, voice="af_heart", speed=1.1) - -for i, (gs, ps, audio) in enumerate(generator): - print(f"Playing chunk {i}...") - sd.play(audio, samplerate=24000) - sd.wait() diff --git a/wayland_narrate.py b/wayland_narrate.py index 9cc53d6..e53819c 100644 --- a/wayland_narrate.py +++ b/wayland_narrate.py @@ -16,6 +16,8 @@ if not text: print("Selection is empty.") sys.exit(0) +text.replace("\n", ".") + print(f"Narrating: {text[:50]}...") # 2. Setup Kokoro (GPU)