# Somali Text-to-Speech — Web App
This is a Next.js demo web app for a Somali Text-to-Speech project (final project). The repository provides a beautiful landing page and a small demo UI that calls a server API route which proxies to a TTS model (Hugging Face Inference API by default).
Getting started
1. Create a working folder and install dependencies (PowerShell):
```powershell
cd "c:\Users\hp\OneDrive\Attachments\Desktop\Somali-Text-To-Speech"
npm install
npm run dev
```
2. Environment variables
Create a `.env.local` file in the project root with:
```
HF_API_KEY=your_huggingface_api_key_here
HF_MODEL=saleolow/somali-mms-tts
```
Replace `HF_MODEL` if you host your own model or want another model id.
3. Try the demo
Open
localhost in your browser. Type Somali text in the demo box and press Speak. The audio is returned and playable and downloadable as a WAV file.
Notes & next steps
- The API route `pages/api/tts.js` uses the Hugging Face Inference API. If you want to run your own server-side model, adjust the API accordingly.
- For production, secure the HF API key and consider streaming large audio responses instead of base64.
Good luck with your final project — if you want, I can now:
- Wire this UI to your local model files (if you upload them here),
- Add styling refinements or animations, or
- Add deployment instructions for Vercel or Docker.
Using a local sample WAV
------------------------
If you already produced a `.wav` using the model on Hugging Face and want to use it in the demo locally, place the file at:
```
public/samples/sample.wav
```
The demo has a "Use sample audio" button which will load and play `/samples/sample.wav` and let you download it from the UI. This is useful if you want to show your own model output without relying on the inference API.