from pathlib import Path
from phostt import Engine
MODEL_DIR = Path.home() / ".phostt" / "models"
TEST_WAV = MODEL_DIR / "test_wavs" / "0.wav"
def main():
if not (MODEL_DIR / "encoder.int8.onnx").exists():
print("Model not found. Run first:")
print(" cargo install phostt && phostt download")
return
engine = Engine(str(MODEL_DIR))
if TEST_WAV.exists():
print(f"Transcribing {TEST_WAV} ...")
text = engine.transcribe_file(str(TEST_WAV))
print("Result:", text)
else:
print(f"Test WAV not found: {TEST_WAV}")
if __name__ == "__main__":
main()