Push-to-talk
Hold to talk. Everyone hears it.
Half-duplex voice among a tenant's enrolled phones. One person talks at a time, everyone else hears it as it is said, and a member who was away hears it when they are back.
The floor
Who may talk, decided in one place.
- One speaker at a time. Others who press wait in a first-in, first-out queue.
- A dispatcher may take the floor from a member.
- The floor is taken back after the longest spurt (30 seconds by default, up to 120) or after a silence (5 seconds by default, up to 30).
- A revoked phone is cut off at once and loses the floor.
- 2 to 64 members in a channel.
Audio
Relayed as it arrives; never decoded.
Each audio frame goes to every connected member as it arrives. Frames are WebSocket binary messages: a 0x50 byte, the kind (1 live, 2 replay), a 32-bit sequence number and the codec payload. Opus is the default; the demo in the browser uses 16 kHz PCM. A browser cannot sign a WebSocket upgrade, so a device first takes a signed, single-use, 30-second ticket.
Offline replay that deletes itself
A member who missed any part of a spurt gets it replayed when they next connect. It waits only for the members who missed it, and only until they confirm they heard it or the offline window passes (24 hours by default, up to 7 days). Then the audio is deleted. The queue is kept in SQLite, so a restart loses nothing.
Sealed, without the voice
Each spurt is sealed on the chain ptt:<channelId> with the SHA-256 of its audio (each payload preceded by its 32-bit length), who spoke, and who heard it live or later (ptt-heard, ptt-expired). The SDK takes the same digest over the frames it received and checks it against the seal; it confirms a replay as heard only when they match.
Babel-fish: everyone in their own language
Each member listens in a language they choose, such as ta-IN.
The speaker's phone listens
Its own speech recogniser writes down what was said and sends it with the spurt, while talking or within 15 seconds of letting go.
Translated once per language
tin-phone asks x-talk once for every language in use in the channel, not once per listener.
Each listener gets theirs
A translation, or the speaker's own words when they share the language (also when translation fails, with the reason). The listener's phone reads it aloud.
Sealed as ptt-transcribed, ptt-translated (digests of both texts and of x-talk's receipt) and ptt-translation-failed. The text is kept only beside the audio for a member who must still hear the replay.
Phone to phone with WebRTC
In a channel of up to eight.
tin-phone relays WebRTC signalling (offer, answer, candidate, bye) between connected members and hands out STUN and TURN servers with a 10-minute TURN credential. A listener on WebRTC tells the socket so, and stops getting live frames over it; the speaker keeps sending frames over the socket, which stays the record. The self-hosted TURN server waits for its ports to be opened.
In code
import { PttClient, webCryptoDeviceSigner } from "@tin-phone/sdk";
const ptt = new PttClient({ apiUrl, signer: await webCryptoDeviceSigner(privateKey, publicKeyDer) });
const talk = await ptt.connect(channelId);
talk.on("audio", (f) => player.play(f.payload)); // live and replayed frames, in order
talk.on("floor", (f) => { // press() only asks for the floor
if (f.state === "granted" && f.holder === talk.me) startSending();
});
talk.press();
// once granted, every 20 ms while the key is held: talk.sendAudio(opusPacket)
// when it is let go: talk.release()
Routes: push-to-talk in the API reference.