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

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 (stefano-pytgvoip-pyrogram in PyPI), could be used as reference.

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

❤️ Donate

If this project helps you, consider buying me a coffee:
PayPal.

..and yes... 😊 the paypal account is correct. Thank you so much!


📜 License

MIT

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.8.0-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.8.0-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.8.0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for stefano_pytgvoip-0.0.8.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2d8f0570b1edf63200c5dee066dc7fdcd74e1ee83fba4a5a0145e114474341d5
MD5 aecf0ce2af3fd7dc000d3211bf3ea5a7
BLAKE2b-256 e9c8b1896628f065595f16da96ebe04e63e7eff5dd86bf6b80fe14c92080aa1c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stefano_pytgvoip-0.0.8.0-cp313-cp313-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 fcfaaf619b82cb0854da567b3dac672185c9ddb1f673fd23abc819531a3fa590
MD5 14effc8d5a68390a19c5a25903568a0b
BLAKE2b-256 fb66c3eaa7fe0c91c17f08b0d866554ca009cf50c2ab9c77aba8eb8d0e8c83f9

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