Skip to content
Telegram VoIP Library for Python
Python C++ PowerShell CMake Other
Branch: master
Clone or download
Latest commit 2dd8dce Jun 29, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
3rdparty Add travis CI config Apr 15, 2019
ci_scripts fix wrong signature May 14, 2019
docs Revert "Do not use cmake" Mar 29, 2019
src bump version May 14, 2019
.gitignore Add travis CI config Apr 15, 2019
.gitmodules cut out dependency on pyrogram Feb 15, 2019
.travis.yml enable tags build only Apr 15, 2019
CMakeLists.txt Revert "Do not use cmake" Mar 29, 2019
COPYING add license Feb 14, 2019
COPYING.lesser add license Feb 14, 2019 Revert "Do not use cmake" Mar 29, 2019
NOTICE add license Feb 14, 2019 Update readme Mar 6, 2019
appveyor.yml change win wheel jobs order May 14, 2019 fix develop version Jun 29, 2019


Read the Docs PyPI AppVeyor (windows wheels) AppVeyor (libtgvoip) LGPLv3+

Telegram VoIP Library for Python

Community | Documentation

PytgVoIP is a Telegram VoIP library written in Python and C++.

It uses libtgvoip (a library used in official clients) for voice encoding and transmission, and pybind11 for simple generation of Python extension written in C++.

It is targeted to MTProto client library developers, detailed usage guide is available here.

An example of usage with Pyrogram is available here (pytgvoip_pyrogram in PyPI), could be used as reference.

Hopefully this module support will be integrated in Pyrogram itself, also @cher-nov has plans to integrate it into Telethon as well


  • Python callbacks for sending and receiving audio stream frames allow flexible control
  • Pre-built Windows wheels in PyPI


  • Python 3.4 or higher

Linux, MacOS: (use binary wheels from PyPI for Windows)

  • libtgvoip
  • CMake, C++11-compatible compiler, Python headers


pip3 install pytgvoip

Install pytgvoip_pyrogram to use this module with Pyrogram.

Encoding audio streams

Streams consumed by libtgvoip should be encoded in 16-bit signed PCM audio.

$ ffmpeg -i input.mp3 -f s16le -ac 1 -ar 48000 -acodec pcm_s16le input.raw  # encode
$ ffmpeg -f s16le -ac 1 -ar 48000 -acodec pcm_s16le -i output.raw output.mp3  # decode

Copyright & License

You can’t perform that action at this time.