VoIP Class Overview
TheVoIP class represents a Telegram voice call:
VoIP Properties
Making Calls
Request a Call
Play Audio from Local File
Play from Stream
Accepting Calls
Handle incoming calls using event handlers:Accept and Play Multiple Files
Playing Audio
Play Single File
Chain Multiple Files
Play on Hold Music
Playback Control
Pause and Resume
Skip to Next Track
Stop Playback
Recording Audio
Set Output Stream
Record to Stream
Call Management
Get Call State
Get Current Playing File
Get Call Verification Emojis
Discard Call
Discard Reasons
Advanced Examples
Voice Message Bot
Music Streaming Bot
Call Recording Bot
Interactive Voice Response (IVR)
VoIP Settings
Configure VoIP settings:Supported Audio Formats
MadelineProto accepts various audio formats:- MP3 - MPEG Audio Layer 3
- OGG - Ogg Vorbis/Opus
- WAV - Waveform Audio
- FLAC - Free Lossless Audio Codec
- M4A - MPEG-4 Audio
Call States
Best Practices
Audio Quality
Audio Quality
Use high-quality audio files:
- Recommended: 48kHz sample rate
- Bitrate: 128kbps or higher
- Format: OGG Opus for best quality
Error Handling
Error Handling
Always handle call failures:
Resource Management
Resource Management
Clean up resources properly:
- Discard calls when done
- Close file streams
- Track active calls
Webhost Support
Webhost Support
VoIP works on webhosts! MadelineProto handles the audio processing automatically, even on shared hosting.