A Go library for streaming audio and video into Telegram group calls, built on top of gogram.
It joins voice/video chats and streams from flexible sources: files, URLs, readers, raw PCM/video frames, or pre-encoded Opus/IVF.
Existing solutions (pytgcalls, ntgcalls, tgcalls, etc.) all wrap libwebrtc or other C++ stacks via bindings. gortc is the first pure-Go implementation — no libwebrtc, no CGo, no native dependencies. The SRTP, DTLS, ICE, and SFU signaling stack is all native Go.
go get github.com/amarnathcjd/gortcclient, _ := telegram.NewClient(telegram.ClientConfig{ /* ... */ })
client.Conn()
call := gortc.NewCall(client, gortc.WithLogLevel(slog.LevelInfo))
call.OnConnected(func() {
go call.Stream(context.Background(), gortc.FromFile("movie.mkv"))
})
if err := call.Join("@mychat"); err != nil {
log.Fatal(err)
}
defer call.Leave()Stream from local files, remote URLs, or any io.Reader — gortc transcodes on the fly. Skip the encoder by passing pre-encoded Opus or IVF, or push raw PCM/video frames directly. Compose sources with Loop and Concat.
examples/basic— join a chat and stream a single file.examples/musicbot— full music bot with queue, pause/resume, skip, volume.
MIT — see LICENSE. The WebRTC stack under webrtc/ is adapted from pion (MIT).