Skip to content
Yuiop7493Public

About

Tcptalk is a simple client-server app in Go that unlike other projects does realtime voicecalls on TCP.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

tcptalk

Peer-to-peer, encrypted voice calls over TCP. Run it on one machine as the server, connect from another as the client, and talk. This was built as a learning project and as a way to make some experiments with TCP calls, it's stupid, ik. I higly recommend to use this locally with both parties connected via cable to reduce latency and jitter.

I gotta admit it was made with a lot of Ai so it isnt that good yet.

Features

  • Real-time full-duplex audio (both sides talk and listen at once)
  • Encrypted and authenticated: X25519 key exchange (forward secrecy) plus ChaCha20-Poly1305, tied to a shared passphrase
  • Noise reduction: pure-Go spectral-subtraction denoiser on the microphone
  • Live input/output level meters
  • Cross-platform: same code on Windows (WASAPI) and Linux (ALSA/PulseAudio)
  • Single self-contained binary, no runtime dependencies

Requirements

To build you need Go and a C compiler (cgo — the audio backend miniaudio is compiled from source). Nothing else.

Windows:

winget install GoLang.Go
winget install BrechtSanders.WinLibs.POSIX.UCRT

Linux (Debian/Ubuntu; use dnf/pacman elsewhere):

sudo apt install -y golang gcc

Build

git clone https://github.com/Yuiop7493/tcptalk.git
cd tcptalk
go mod tidy
go build -o tcptalk .

For a fully self-contained binary you can copy to another machine:

CGO_ENABLED=1 CGO_LDFLAGS=-static go build -o tcptalk .

Usage

tcptalk server [port]         listen and wait for a call (default 4000)
tcptalk client <ip>[:port]    call a server

Two machines:

# Machine A
tcptalk server

# Machine B
tcptalk client 192.168.1.42

Both sides are asked for a passphrase; it must be identical on both (it authenticates the call and derives the encryption keys). On the server machine, allow inbound TCP on the port in the firewall.

To test on a single machine, run the server in one terminal and client 127.0.0.1 in another — use headphones to avoid feedback.

Configuration

Environment variables:

  • TCPTALK_KEY — passphrase (skips the prompt)
  • TCPTALK_DENOISE=0 — turn noise reduction off
  • TCPTALK_METER=0 — hide the level meters
  • NO_COLOR — disable colored output

Audio and denoise parameters live at the top of main.go and denoise.go.

How it works

mic -> denoise (STFT) -> encrypt -> TCP -> decrypt -> jitter buffer -> speaker
  • Transport: TCP with a 2-byte length prefix per frame and TCP_NODELAY. Fine on a LAN, where packet loss is close to zero; UDP would be the move to go beyond it.
  • Audio: raw PCM int16, mono, 48 kHz, 10 ms frames.
  • Crypto: ephemeral X25519 -> HKDF (mixed with an Argon2id passphrase key) -> per-direction ChaCha20-Poly1305 with counter nonces; an HMAC key-confirmation step rejects a wrong passphrase or a MITM before any audio flows.
  • Denoise: short-time FFT, adaptive per-bin noise estimate, spectral subtraction, overlap-add.

Source files: main.go (CLI, audio, networking), secure.go (crypto), denoise.go (DSP), ui.go (terminal output).

Security

The cryptography is assembled from vetted primitives (Go's standard crypto packages and golang.org/x/crypto). It is fine for calls between your own machines on a LAN, but it has not been independently audited. For high-stakes use, prefer TLS 1.3 or the Noise framework.

Roadmap

  • UDP transport with a proper jitter buffer
  • Opus codec (lower bandwidth)
  • Multi-client via a relay server (true end-to-end)
  • Optional GUI

License

MIT © 2026 Yuiop7493. See LICENSE.

About

Tcptalk is a simple client-server app in Go that unlike other projects does realtime voicecalls on TCP.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages