Skip to main content
You will build: a one-page web app with two buttons, Hausa → French and French → Hausa. Hold a button, speak, release: the page shows what was understood, the translation, and plays it aloud. One API call per turn. You will need: Node 23.6+ to run the .ts file directly (or compile it), npm install express multer namu-ai (JavaScript library), and NAMU_API_KEY set.
1

The server

It receives the browser’s recording, calls /v1/translate with include_audio, and returns the result. The key never leaves it.
server.ts
2

The page

The browser records with MediaRecorder (WebM Opus), which the API reads as it is.
public/index.html
3

Run it

Open http://localhost:3000, allow the microphone, hold a button and speak.

Before real people use it

  • Put your own sign-in in front of /translate, or anyone who finds the page spends your allowance.
  • Show heard so both people can see what was understood; that is often where a misunderstanding starts.
  • For health, legal or money conversations, keep a human interpreter in the loop.

Next

Translation

Every option

Building for weak networks

Make it work on 3G