Code Monkey home page Code Monkey logo

pytgvoip's Introduction

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

pytgvoip's People

Contributors

bakatrouble avatar alissonlauffer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.