import sounddevice as sd
from vosk import Model, KaldiRecognizer
from pynput.keyboard import Controller
import time
import os

with open("/home/universal/.gemini/tmp/428d098e581799ff7817b2001dd545f7b891975897338dd78498cc16582e004f/test.log", "w") as f:
    f.write("test")

SAMPLE_RATE = 16000
BLOCK_SIZE = 8000
# Use absolute path to model directory
MODEL_PATH = os.path.join(os.path.dirname(__file__), '..', 'src', 'dictation_service', 'vosk-model-small-en-us-0.15')
MODEL_PATH = os.path.abspath(MODEL_PATH)

def audio_callback(indata, frames, time, status):
    pass

keyboard = Controller()
model = Model(MODEL_PATH)
recognizer = KaldiRecognizer(model, SAMPLE_RATE)

with sd.RawInputStream(samplerate=SAMPLE_RATE, blocksize=BLOCK_SIZE, dtype='int16',
                       channels=1, callback=audio_callback):
    time.sleep(10)