TgCaller
[](https://pypi.org/project/tgcaller/)
[](https://python.org)
[](https://github.com/tgcaller/TgCaller/blob/main/LICENSE)
[](https://pypi.org/project/tgcaller/)
[](https://github.com/TgCaller/TgCaller)
**🎯 Modern, Fast, and Reliable Telegram Group Calls Library**
*Built for developers who need a simple yet powerful solution for Telegram voice and video calls*
[Get Started](installation.md){ .md-button .md-button--primary }
[View on GitHub](https://github.com/TgCaller/TgCaller){ .md-button }
⚡ Why TgCaller?
TgCaller is a modern alternative to pytgcalls, designed with developer experience and reliability in mind:
- 🚀 Fast & Lightweight: Optimized performance, 3x faster connection times compared to alternatives.
- 📱 Easy to Use: Simple, intuitive API with less boilerplate code, more functionality.
- 🔧 Reliable: Built-in error handling and auto-recovery. <2% error rate in production environments.
- 📹 HD Support: High-quality audio and video streaming with support for 720p and 1080p video calls.
- 🔌 Extensible: Plugin system for custom features. Extend functionality without modifying core code.
- 📚 Well Documented: Comprehensive guides and examples. Complete API reference with interactive examples.
🚀 Quick Start
Installation
Verify Installation
# Test installation
tgcaller test
# Check system info
tgcaller info
# Show examples
tgcaller examples
Basic Usage
import asyncio
from pyrogram import Client
from tgcaller import TgCaller
# Initialize
app = Client("my_session", api_id=API_ID, api_hash=API_HASH)
caller = TgCaller(app)
@caller.on_stream_end
async def on_stream_end(client, update):
print(f"Stream ended in {update.chat_id}")
async def main():
await caller.start()
# Join voice call
await caller.join_call(-1001234567890)
# Play audio
await caller.play(-1001234567890, "song.mp3")
if __name__ == "__main__":
asyncio.run(main())
🎵 Features
Audio Streaming
- Multiple quality presets (high quality, low bandwidth)
- Opus and AAC codec support
- Noise suppression and echo cancellation
- Real-time volume control
- Seek functionality
Video Streaming
- 720p and 1080p HD support
- H.264 and VP8 codec support
- Hardware acceleration
- Multiple resolution presets
Advanced Features
- 🌉 Bridged Calls - Connect multiple chats
- 🎤 Microphone Streaming - Live microphone input
- 🖥️ Screen Sharing - Share your screen
- 🎬 YouTube Integration - Stream YouTube videos
- 🎤 Speech Transcription - Real-time speech-to-text
- 🎛️ Audio/Video Filters - Apply real-time effects
📊 Performance Comparison
Feature | TgCaller | pytgcalls | Improvement |
---|---|---|---|
Connection Time | ~1s | ~3s | 3x faster |
Memory Usage | 80MB | 150MB | 47% less |
CPU Usage | Low | High | 60% less |
Error Rate | <2% | ~8% | 4x more reliable |
🎮 Examples
Music Bot
from pyrogram import Client, filters
from tgcaller import TgCaller, AudioConfig
app = Client("music_bot")
caller = TgCaller(app)
@app.on_message(filters.command("play"))
async def play_music(client, message):
if len(message.command) < 2:
return await message.reply("Usage: /play <song_name>")
song = message.command[1]
chat_id = message.chat.id
# Join call if not already joined
if not caller.is_connected(chat_id):
await caller.join_call(chat_id)
await message.reply("📞 Joined voice chat!")
# Play song
audio_config = AudioConfig.high_quality()
await caller.play(chat_id, f"music/{song}.mp3", audio_config=audio_config)
await message.reply(f"🎵 Playing: {song}")
@caller.on_stream_end
async def on_stream_end(client, update):
print(f"Stream ended in {update.chat_id}")
app.run()
Advanced Features
from tgcaller.advanced import (
BridgedCallManager,
MicrophoneStreamer,
ScreenShareStreamer,
YouTubeStreamer
)
# Bridge multiple chats
bridge_manager = BridgedCallManager(caller)
await bridge_manager.create_bridge("conference", [chat1, chat2, chat3])
# Stream microphone
mic_streamer = MicrophoneStreamer(caller, chat_id)
await mic_streamer.start_streaming()
# Share screen
screen_streamer = ScreenShareStreamer(caller, chat_id)
await screen_streamer.start_streaming(monitor_index=1)
# Stream YouTube
youtube = YouTubeStreamer(caller)
await youtube.play_youtube_url(chat_id, "https://youtube.com/watch?v=...")
🛠️ CLI Tools
TgCaller comes with powerful CLI tools:
# Test installation
tgcaller test --api-id 12345 --api-hash "your_hash"
# System diagnostics
tgcaller diagnose
# Show examples
tgcaller examples
# Get help
tgcaller --help
🤝 Community
- GitHub - Source code and issues
- Telegram Group - Get help and discuss
- Documentation - Complete guides
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ for the Telegram developer community