Skip to main content

Telegram VoIP Library for Python

Project description

pytgvoip

Read the Docs PyPI AppVeyor (windows wheels) 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

Features

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

Requirements

  • Python 3.5 or higher

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

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

Installing

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

stefano_pytgvoip-0.0.7.5-cp313-cp313-musllinux_1_2_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

stefano_pytgvoip-0.0.7.5-cp313-cp313-musllinux_1_2_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ ARM64

File details

Details for the file stefano_pytgvoip-0.0.7.5-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for stefano_pytgvoip-0.0.7.5-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c7ba761bf11bbe56e56bc3481ebcfd853651281020814a6fc08e0b55c33a49bb
MD5 06c3f2f462a939a83e475785833bca4c
BLAKE2b-256 dc78649211d803ebd597d5c6cfb39ad782b822f5b4a81523904e9603d3b3e937

See more details on using hashes here.

File details

Details for the file stefano_pytgvoip-0.0.7.5-cp313-cp313-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for stefano_pytgvoip-0.0.7.5-cp313-cp313-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e975705064d08517814c2026ec9f82ea3b0f794620a0de7f97d35fb7fcb60e6d
MD5 679591d95c1b5afc8d901fc5231636af
BLAKE2b-256 e4371545da1eeab5d477d6e529a568310e3266efbdb19359cfd93812021304b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page