Package pytgcalls

Expand source code
#  tgcalls - Python binding for tgcalls (c++ lib by Telegram)
#  pytgcalls - Library connecting python binding for tgcalls and Pyrogram
#  Copyright (C) 2020-2021 Il`ya (Marshal) <https://github.com/MarshalX>
#
#  This file is part of tgcalls and pytgcalls.
#
#  tgcalls and pytgcalls is free software: you can redistribute it and/or modify
#  it under the terms of the GNU Lesser General Public License as published
#  by the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  tgcalls and pytgcalls is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public License v3
#  along with tgcalls. If not, see <http://www.gnu.org/licenses/>.

from pytgcalls.group_call_native import GroupCallNative, GroupCallNativeAction, GroupCallNativeDispatcherMixin
from pytgcalls.action import Action
from pytgcalls.group_call import GroupCall, GroupCallAction, GroupCallDispatcherMixin
from pytgcalls.group_call_raw import GroupCallRaw
from pytgcalls.group_call_device import GroupCallDevice
from pytgcalls.dispatcher import Dispatcher
from pytgcalls.dispatcher_mixin import DispatcherMixin

__all__ = ['GroupCallNative', 'GroupCall', 'GroupCallRaw', 'GroupCallDevice', 'Dispatcher', 'DispatcherMixin', 'Action',
           'GroupCallNativeAction', 'GroupCallNativeDispatcherMixin', 'GroupCallAction', 'GroupCallDispatcherMixin']
__version__ = '0.0.22'
__pdoc__ = {
    'Action': False,
    'Dispatcher': False,
    'DispatcherMixin': False,
    'GroupCallDispatcherMixin': False,
    'GroupCallNativeAction': False,
    'GroupCallNativeDispatcherMixin': False,
    'GroupCallNative': False,
}

Sub-modules

pytgcalls.action
pytgcalls.dispatcher
pytgcalls.dispatcher_mixin
pytgcalls.group_call
pytgcalls.group_call_device
pytgcalls.group_call_native
pytgcalls.group_call_raw

Classes

class GroupCall (client: Union[pyrogram.client.Client, NoneType] = None, input_filename: str = None, output_filename: str = None, play_on_repeat=True, enable_logs_to_console=False, path_to_log_file=None)
Expand source code
class GroupCall(GroupCallNative, GroupCallDispatcherMixin):

    def __init__(
            self,
            client: Union[pyrogram.Client, None] = None,
            input_filename: str = None,
            output_filename: str = None,
            play_on_repeat=True,
            enable_logs_to_console=False,
            path_to_log_file=None
    ):
        super().__init__(client, enable_logs_to_console, path_to_log_file)
        super(GroupCallDispatcherMixin, self).__init__(GroupCallAction)

        self.play_on_repeat = play_on_repeat
        '''When the file ends, play it again'''
        self.__is_playout_paused = False
        self.__is_recording_paused = False

        self.__input_filename = input_filename or ''
        self.__output_filename = output_filename or ''

        self.__file_audio_device_descriptor = None

    def __create_and_return_file_audio_device_descriptor(self):
        self.__file_audio_device_descriptor = tgcalls.FileAudioDeviceDescriptor()
        self.__file_audio_device_descriptor.getInputFilename = self.__get_input_filename_callback
        self.__file_audio_device_descriptor.getOutputFilename = self.__get_output_filename_callback
        self.__file_audio_device_descriptor.isEndlessPlayout = self.__is_endless_playout_callback
        self.__file_audio_device_descriptor.isPlayoutPaused = self.__is_playout_paused_callback
        self.__file_audio_device_descriptor.isRecordingPaused = self.__is_recording_paused_callback
        self.__file_audio_device_descriptor.playoutEndedCallback = self.__playout_ended_callback

        return self.__file_audio_device_descriptor

    def _setup_and_start_group_call(self):
        self._start_native_group_call(self.__create_and_return_file_audio_device_descriptor())

    def stop_playout(self):
        """Stop playing of file."""

        self.input_filename = ''

    def stop_output(self):
        """Stop recording to file."""

        self.output_filename = ''

    @property
    def input_filename(self):
        """Input filename (or path) to play."""

        return self.__input_filename

    @input_filename.setter
    def input_filename(self, filename):
        self.__input_filename = filename or ''
        if self.is_connected:
            self.restart_playout()

    @property
    def output_filename(self):
        """Output filename (or path) to record."""

        return self.__output_filename

    @output_filename.setter
    def output_filename(self, filename):
        self.__output_filename = filename or ''
        if self.is_connected:
            self.restart_recording()

    def pause_playout(self):
        """Pause playout (playing from file)."""
        self.__is_playout_paused = True

    def resume_playout(self):
        """Resume playout (playing from file)."""
        self.__is_playout_paused = False

    def pause_recording(self):
        """Pause recording (output to file)."""
        self.__is_recording_paused = True

    def resume_recording(self):
        """Resume recording (output to file)."""
        self.__is_recording_paused = False

    def __get_input_filename_callback(self):
        return self.__input_filename

    def __get_output_filename_callback(self):
        return self.__output_filename

    def __is_endless_playout_callback(self):
        return self.play_on_repeat

    def __is_playout_paused_callback(self):
        return self.__is_playout_paused

    def __is_recording_paused_callback(self):
        return self.__is_recording_paused

    def __playout_ended_callback(self, input_filename: str):
        self.trigger_handlers(GroupCallAction.PLAYOUT_ENDED, self, input_filename)

Ancestors

Class variables

var SEND_ACTION_UPDATE_EACH

Inherited from: GroupCallNative.SEND_ACTION_UPDATE_EACH

How often to send speaking action to chat

Instance variables

var chat_peer

Inherited from: GroupCallNative.chat_peer

Chat peer where bot is now

var client

Inherited from: GroupCallNative.client

Client of Pyrogram

var enable_action

Inherited from: GroupCallNative.enable_action

Is enable sending of speaking action

var full_chat

Inherited from: GroupCallNative.full_chat

Full chat information

var group_call

Inherited from: GroupCallNative.group_call

Instance of Pyrogram's group call

var input_filename

Input filename (or path) to play.

Expand source code
@property
def input_filename(self):
    """Input filename (or path) to play."""

    return self.__input_filename
var invite_hash

Inherited from: GroupCallNative.invite_hash

Hash from invite link to join as speaker

var is_connected

Inherited from: GroupCallNative.is_connected

Is connected to voice chat via tgcalls

var join_as

Inherited from: GroupCallNative.join_as

How to present yourself in participants list

var my_peer

Inherited from: GroupCallNative.my_peer

Client user peer

var my_ssrc

Inherited from: GroupCallNative.my_ssrc

Client SSRC (Synchronization Source)

var output_filename

Output filename (or path) to record.

Expand source code
@property
def output_filename(self):
    """Output filename (or path) to record."""

    return self.__output_filename
var play_on_repeat

When the file ends, play it again

Methods

def add_handler(self, callback: collections.abc.Coroutine, action: str) ‑> collections.abc.Coroutine

Inherited from: GroupCallNative.add_handler

Register new handler …

async def check_group_call(self) ‑> bool

Inherited from: GroupCallNative.check_group_call

Check if client is in a voice chat …

async def edit_group_call(self, volume: int = None, muted=False)

Inherited from: GroupCallNative.edit_group_call

Edit own settings of group call …

async def edit_group_call_member(self, peer: pyrogram.raw.base.peer.Peer, volume: int = None, muted=False)

Inherited from: GroupCallNative.edit_group_call_member

Edit setting of user in voice chat (required voice chat management permission) …

async def get_group_call(self, group: Union[str, int, pyrogram.raw.types.input_peer_channel.InputPeerChannel, pyrogram.raw.types.input_peer_chat.InputPeerChat])

Inherited from: GroupCallNative.get_group_call

Get group call input of chat …

async def get_group_call_participants(self)

Inherited from: GroupCallNative.get_group_call_participants

Get group call participants of current chat.

async def leave_current_group_call(self)

Inherited from: GroupCallNative.leave_current_group_call

Leave group call from server side (MTProto part).

def on_network_status_changed(self, func: Coroutine) ‑> Coroutine

Inherited from: GroupCallNative.on_network_status_changed

When a status of network will be changed …

def on_playout_ended(self, func: Coroutine) ‑> Coroutine

Inherited from: GroupCallDispatcherMixin.on_playout_ended

When a input file is ended …

def pause_playout(self)

Pause playout (playing from file).

Expand source code
def pause_playout(self):
    """Pause playout (playing from file)."""
    self.__is_playout_paused = True
def pause_recording(self)

Pause recording (output to file).

Expand source code
def pause_recording(self):
    """Pause recording (output to file)."""
    self.__is_recording_paused = True
def print_available_playout_devices(self)

Inherited from: GroupCallNative.print_available_playout_devices

Print name and guid of available playout audio devices in system. Just helper method …

def print_available_recording_devices(self)

Inherited from: GroupCallNative.print_available_recording_devices

Print name and guid of available recording audio devices in system. Just helper method …

async def reconnect(self)

Inherited from: GroupCallNative.reconnect

Connect to voice chat using the same native instance.

def remove_handler(self, callback: collections.abc.Coroutine, action: str) ‑> bool

Inherited from: GroupCallNative.remove_handler

Unregister the handler …

def remove_update_handler(self)

Inherited from: GroupCallNative.remove_update_handler

Remove pytgcalls handler in pyrogram client.

def restart_playout(self)

Inherited from: GroupCallNative.restart_playout

Start play current input file from start or just reload file audio device …

def restart_recording(self)

Inherited from: GroupCallNative.restart_recording

Start recording to output file from begin or just restart recording device …

def resume_playout(self)

Resume playout (playing from file).

Expand source code
def resume_playout(self):
    """Resume playout (playing from file)."""
    self.__is_playout_paused = False
def resume_recording(self)

Resume recording (output to file).

Expand source code
def resume_recording(self):
    """Resume recording (output to file)."""
    self.__is_recording_paused = False
async def send_speaking_group_call_action(self)

Inherited from: GroupCallNative.send_speaking_group_call_action

Send speaking action to current chat.

def set_audio_input_device(self, name: Union[str, NoneType] = None)

Inherited from: GroupCallNative.set_audio_input_device

Set audio input device …

def set_audio_output_device(self, name: Union[str, NoneType] = None)

Inherited from: GroupCallNative.set_audio_output_device

Set audio output device …

def set_is_mute(self, is_muted: bool)

Inherited from: GroupCallNative.set_is_mute

Set is mute …

async def set_my_volume(self, volume)

Inherited from: GroupCallNative.set_my_volume

Set volume for current client …

async def start(self, group: Union[str, int, pyrogram.raw.types.input_peer_channel.InputPeerChannel, pyrogram.raw.types.input_peer_chat.InputPeerChat], join_as: Union[str, int, pyrogram.raw.types.input_peer_channel.InputPeerChannel, pyrogram.raw.types.input_peer_chat.InputPeerChat, pyrogram.raw.types.input_peer_user.InputPeerUser, NoneType] = None, invite_hash: Union[str, NoneType] = None, enable_action=True)

Inherited from: GroupCallNative.start

Start voice chat (join and play/record from initial values) …

async def stop(self)

Inherited from: GroupCallNative.stop

Properly stop tgcalls, remove pyrogram handler, leave from server side.

def stop_output(self)

Stop recording to file.

Expand source code
def stop_output(self):
    """Stop recording to file."""

    self.output_filename = ''
def stop_playout(self)

Stop playing of file.

Expand source code
def stop_playout(self):
    """Stop playing of file."""

    self.input_filename = ''
def trigger_handlers(self, action: str, instance: GroupCallNative, *args, **kwargs)

Inherited from: GroupCallNative.trigger_handlers

Unregister the handler …

class GroupCallAction
Expand source code
class GroupCallAction(GroupCallNativeAction):
    PLAYOUT_ENDED = Action()
    '''When a input file is ended.'''

Ancestors

Class variables

var NETWORK_STATUS_CHANGED

Inherited from: GroupCallNativeAction.NETWORK_STATUS_CHANGED

When a status of network will be changed.

var PLAYOUT_ENDED

When a input file is ended.

class GroupCallDevice (client: Union[pyrogram.client.Client, NoneType] = None, audio_input_device: Union[str, NoneType] = None, audio_output_device: Union[str, NoneType] = None, enable_logs_to_console=False, path_to_log_file=None)
Expand source code
class GroupCallDevice(GroupCallNative):

    def __init__(
            self,
            client: Union[pyrogram.Client, None] = None,
            audio_input_device: Optional[str] = None,
            audio_output_device: Optional[str] = None,
            enable_logs_to_console=False,
            path_to_log_file=None
    ):
        super().__init__(client, enable_logs_to_console, path_to_log_file)

        self.__is_playout_paused = False
        self.__is_recording_paused = False

        self.__raw_audio_device_descriptor = None

        self.__audio_input_device = audio_input_device or ''
        self.__audio_output_device = audio_output_device or ''

    def _setup_and_start_group_call(self):
        self._start_native_group_call(self.__audio_input_device, self.__audio_output_device)

    @property
    def audio_input_device(self):
        """Get audio input device name or GUID

        Note:
            To get system recording device list you can use `print_available_recording_devices()` method.
        """

        return self.__audio_input_device

    @audio_input_device.setter
    def audio_input_device(self, name=None):
        self.set_audio_input_device(name)

    @property
    def audio_output_device(self):
        """Get audio output device name or GUID

        Note:
            To get system playout device list you can use `print_available_playout_devices()` method.
        """

        return self.__audio_output_device

    @audio_output_device.setter
    def audio_output_device(self, name=None):
        self.set_audio_output_device(name)

Ancestors

Class variables

var SEND_ACTION_UPDATE_EACH

Inherited from: GroupCallNative.SEND_ACTION_UPDATE_EACH

How often to send speaking action to chat

Instance variables

var audio_input_device

Get audio input device name or GUID

Note

To get system recording device list you can use print_available_recording_devices() method.

Expand source code
@property
def audio_input_device(self):
    """Get audio input device name or GUID

    Note:
        To get system recording device list you can use `print_available_recording_devices()` method.
    """

    return self.__audio_input_device
var audio_output_device

Get audio output device name or GUID

Note

To get system playout device list you can use print_available_playout_devices() method.

Expand source code
@property
def audio_output_device(self):
    """Get audio output device name or GUID

    Note:
        To get system playout device list you can use `print_available_playout_devices()` method.
    """

    return self.__audio_output_device
var chat_peer

Inherited from: GroupCallNative.chat_peer

Chat peer where bot is now

var client

Inherited from: GroupCallNative.client

Client of Pyrogram

var enable_action

Inherited from: GroupCallNative.enable_action

Is enable sending of speaking action

var full_chat

Inherited from: GroupCallNative.full_chat

Full chat information

var group_call

Inherited from: GroupCallNative.group_call

Instance of Pyrogram's group call

var invite_hash

Inherited from: GroupCallNative.invite_hash

Hash from invite link to join as speaker

var is_connected

Inherited from: GroupCallNative.is_connected

Is connected to voice chat via tgcalls

var join_as

Inherited from: GroupCallNative.join_as

How to present yourself in participants list

var my_peer

Inherited from: GroupCallNative.my_peer

Client user peer

var my_ssrc

Inherited from: GroupCallNative.my_ssrc

Client SSRC (Synchronization Source)

Methods

def add_handler(self, callback: collections.abc.Coroutine, action: str) ‑> collections.abc.Coroutine

Inherited from: GroupCallNative.add_handler

Register new handler …

async def check_group_call(self) ‑> bool

Inherited from: GroupCallNative.check_group_call

Check if client is in a voice chat …

async def edit_group_call(self, volume: int = None, muted=False)

Inherited from: GroupCallNative.edit_group_call

Edit own settings of group call …

async def edit_group_call_member(self, peer: pyrogram.raw.base.peer.Peer, volume: int = None, muted=False)

Inherited from: GroupCallNative.edit_group_call_member

Edit setting of user in voice chat (required voice chat management permission) …

async def get_group_call(self, group: Union[str, int, pyrogram.raw.types.input_peer_channel.InputPeerChannel, pyrogram.raw.types.input_peer_chat.InputPeerChat])

Inherited from: GroupCallNative.get_group_call

Get group call input of chat …

async def get_group_call_participants(self)

Inherited from: GroupCallNative.get_group_call_participants

Get group call participants of current chat.

async def leave_current_group_call(self)

Inherited from: GroupCallNative.leave_current_group_call

Leave group call from server side (MTProto part).

def on_network_status_changed(self, func: Coroutine) ‑> Coroutine

Inherited from: GroupCallNative.on_network_status_changed

When a status of network will be changed …

def print_available_playout_devices(self)

Inherited from: GroupCallNative.print_available_playout_devices

Print name and guid of available playout audio devices in system. Just helper method …

def print_available_recording_devices(self)

Inherited from: GroupCallNative.print_available_recording_devices

Print name and guid of available recording audio devices in system. Just helper method …

async def reconnect(self)

Inherited from: GroupCallNative.reconnect

Connect to voice chat using the same native instance.

def remove_handler(self, callback: collections.abc.Coroutine, action: str) ‑> bool

Inherited from: GroupCallNative.remove_handler

Unregister the handler …

def remove_update_handler(self)

Inherited from: GroupCallNative.remove_update_handler

Remove pytgcalls handler in pyrogram client.

def restart_playout(self)

Inherited from: GroupCallNative.restart_playout

Start play current input file from start or just reload file audio device …

def restart_recording(self)

Inherited from: GroupCallNative.restart_recording

Start recording to output file from begin or just restart recording device …

async def send_speaking_group_call_action(self)

Inherited from: GroupCallNative.send_speaking_group_call_action

Send speaking action to current chat.

def set_audio_input_device(self, name: Union[str, NoneType] = None)

Inherited from: GroupCallNative.set_audio_input_device

Set audio input device …

def set_audio_output_device(self, name: Union[str, NoneType] = None)

Inherited from: GroupCallNative.set_audio_output_device

Set audio output device …

def set_is_mute(self, is_muted: bool)

Inherited from: GroupCallNative.set_is_mute

Set is mute …

async def set_my_volume(self, volume)

Inherited from: GroupCallNative.set_my_volume

Set volume for current client …

async def start(self, group: Union[str, int, pyrogram.raw.types.input_peer_channel.InputPeerChannel, pyrogram.raw.types.input_peer_chat.InputPeerChat], join_as: Union[str, int, pyrogram.raw.types.input_peer_channel.InputPeerChannel, pyrogram.raw.types.input_peer_chat.InputPeerChat, pyrogram.raw.types.input_peer_user.InputPeerUser, NoneType] = None, invite_hash: Union[str, NoneType] = None, enable_action=True)

Inherited from: GroupCallNative.start

Start voice chat (join and play/record from initial values) …

async def stop(self)

Inherited from: GroupCallNative.stop

Properly stop tgcalls, remove pyrogram handler, leave from server side.

def trigger_handlers(self, action: str, instance: GroupCallNative, *args, **kwargs)

Inherited from: GroupCallNative.trigger_handlers

Unregister the handler …

class GroupCallRaw (client: Union[pyrogram.client.Client, NoneType] = None, on_played_data: Callable[[_ForwardRef('GroupCallRaw'), int], bytes] = None, on_recorded_data: Callable[[_ForwardRef('GroupCallRaw'), bytes, int], NoneType] = None, enable_logs_to_console=False, path_to_log_file=None)
Expand source code
class GroupCallRaw(GroupCallNative):

    def __init__(
            self,
            client: Union[pyrogram.Client, None] = None,
            on_played_data: Callable[['GroupCallRaw', int], bytes] = None,
            on_recorded_data: Callable[['GroupCallRaw', bytes, int], None] = None,
            enable_logs_to_console=False,
            path_to_log_file=None
    ):
        super().__init__(client, enable_logs_to_console, path_to_log_file)

        self.__is_playout_paused = False
        self.__is_recording_paused = False

        self.__raw_audio_device_descriptor = None

        self.on_played_data = on_played_data
        self.on_recorded_data = on_recorded_data

    def __create_and_return_raw_audio_device_descriptor(self):
        self.__raw_audio_device_descriptor = tgcalls.RawAudioDeviceDescriptor()
        self.__raw_audio_device_descriptor.getPlayedBufferCallback = self.__get_played_buffer_callback
        self.__raw_audio_device_descriptor.setRecordedBufferCallback = self.__set_recorded_buffer_callback
        self.__raw_audio_device_descriptor.isPlayoutPaused = self.__is_playout_paused_callback
        self.__raw_audio_device_descriptor.isRecordingPaused = self.__is_recording_paused_callback

        return self.__raw_audio_device_descriptor

    def _setup_and_start_group_call(self):
        self._start_native_group_call(self.__create_and_return_raw_audio_device_descriptor())

    def __get_played_buffer_callback(self, length: int):
        frame = b''
        if self.on_played_data:
            data = self.on_played_data(self, length)
            if data:
                frame = data

        return frame.ljust(length, b'\0')

    def __set_recorded_buffer_callback(self, frame: bytes, length: int):
        if self.on_recorded_data:
            self.on_recorded_data(self, frame, length)

    def pause_playout(self):
        """Pause playout (playing from callback)."""
        self.__is_playout_paused = True

    def resume_playout(self):
        """Resume playout (playing from callback)."""
        self.__is_playout_paused = False

    def pause_recording(self):
        """Pause recording (output to callback)."""
        self.__is_recording_paused = True

    def resume_recording(self):
        """Resume recording (output to callback)."""
        self.__is_recording_paused = False

    def __is_playout_paused_callback(self):
        return self.__is_playout_paused

    def __is_recording_paused_callback(self):
        return self.__is_recording_paused

    """Stop requesting new data to send."""
    stop_playout = pause_playout
    """Stop getting raw data."""
    stop_output = pause_recording

Ancestors

Class variables

var SEND_ACTION_UPDATE_EACH

Inherited from: GroupCallNative.SEND_ACTION_UPDATE_EACH

How often to send speaking action to chat

Instance variables

var chat_peer

Inherited from: GroupCallNative.chat_peer

Chat peer where bot is now

var client

Inherited from: GroupCallNative.client

Client of Pyrogram

var enable_action

Inherited from: GroupCallNative.enable_action

Is enable sending of speaking action

var full_chat

Inherited from: GroupCallNative.full_chat

Full chat information

var group_call

Inherited from: GroupCallNative.group_call

Instance of Pyrogram's group call

var invite_hash

Inherited from: GroupCallNative.invite_hash

Hash from invite link to join as speaker

var is_connected

Inherited from: GroupCallNative.is_connected

Is connected to voice chat via tgcalls

var join_as

Inherited from: GroupCallNative.join_as

How to present yourself in participants list

var my_peer

Inherited from: GroupCallNative.my_peer

Client user peer

var my_ssrc

Inherited from: GroupCallNative.my_ssrc

Client SSRC (Synchronization Source)

Methods

def add_handler(self, callback: collections.abc.Coroutine, action: str) ‑> collections.abc.Coroutine

Inherited from: GroupCallNative.add_handler

Register new handler …

async def check_group_call(self) ‑> bool

Inherited from: GroupCallNative.check_group_call

Check if client is in a voice chat …

async def edit_group_call(self, volume: int = None, muted=False)

Inherited from: GroupCallNative.edit_group_call

Edit own settings of group call …

async def edit_group_call_member(self, peer: pyrogram.raw.base.peer.Peer, volume: int = None, muted=False)

Inherited from: GroupCallNative.edit_group_call_member

Edit setting of user in voice chat (required voice chat management permission) …

async def get_group_call(self, group: Union[str, int, pyrogram.raw.types.input_peer_channel.InputPeerChannel, pyrogram.raw.types.input_peer_chat.InputPeerChat])

Inherited from: GroupCallNative.get_group_call

Get group call input of chat …

async def get_group_call_participants(self)

Inherited from: GroupCallNative.get_group_call_participants

Get group call participants of current chat.

async def leave_current_group_call(self)

Inherited from: GroupCallNative.leave_current_group_call

Leave group call from server side (MTProto part).

def on_network_status_changed(self, func: Coroutine) ‑> Coroutine

Inherited from: GroupCallNative.on_network_status_changed

When a status of network will be changed …

def pause_playout(self)

Pause playout (playing from callback).

Expand source code
def pause_playout(self):
    """Pause playout (playing from callback)."""
    self.__is_playout_paused = True
def pause_recording(self)

Pause recording (output to callback).

Expand source code
def pause_recording(self):
    """Pause recording (output to callback)."""
    self.__is_recording_paused = True
def print_available_playout_devices(self)

Inherited from: GroupCallNative.print_available_playout_devices

Print name and guid of available playout audio devices in system. Just helper method …

def print_available_recording_devices(self)

Inherited from: GroupCallNative.print_available_recording_devices

Print name and guid of available recording audio devices in system. Just helper method …

async def reconnect(self)

Inherited from: GroupCallNative.reconnect

Connect to voice chat using the same native instance.

def remove_handler(self, callback: collections.abc.Coroutine, action: str) ‑> bool

Inherited from: GroupCallNative.remove_handler

Unregister the handler …

def remove_update_handler(self)

Inherited from: GroupCallNative.remove_update_handler

Remove pytgcalls handler in pyrogram client.

def restart_playout(self)

Inherited from: GroupCallNative.restart_playout

Start play current input file from start or just reload file audio device …

def restart_recording(self)

Inherited from: GroupCallNative.restart_recording

Start recording to output file from begin or just restart recording device …

def resume_playout(self)

Resume playout (playing from callback).

Expand source code
def resume_playout(self):
    """Resume playout (playing from callback)."""
    self.__is_playout_paused = False
def resume_recording(self)

Resume recording (output to callback).

Expand source code
def resume_recording(self):
    """Resume recording (output to callback)."""
    self.__is_recording_paused = False
async def send_speaking_group_call_action(self)

Inherited from: GroupCallNative.send_speaking_group_call_action

Send speaking action to current chat.

def set_audio_input_device(self, name: Union[str, NoneType] = None)

Inherited from: GroupCallNative.set_audio_input_device

Set audio input device …

def set_audio_output_device(self, name: Union[str, NoneType] = None)

Inherited from: GroupCallNative.set_audio_output_device

Set audio output device …

def set_is_mute(self, is_muted: bool)

Inherited from: GroupCallNative.set_is_mute

Set is mute …

async def set_my_volume(self, volume)

Inherited from: GroupCallNative.set_my_volume

Set volume for current client …

async def start(self, group: Union[str, int, pyrogram.raw.types.input_peer_channel.InputPeerChannel, pyrogram.raw.types.input_peer_chat.InputPeerChat], join_as: Union[str, int, pyrogram.raw.types.input_peer_channel.InputPeerChannel, pyrogram.raw.types.input_peer_chat.InputPeerChat, pyrogram.raw.types.input_peer_user.InputPeerUser, NoneType] = None, invite_hash: Union[str, NoneType] = None, enable_action=True)

Inherited from: GroupCallNative.start

Start voice chat (join and play/record from initial values) …

async def stop(self)

Inherited from: GroupCallNative.stop

Properly stop tgcalls, remove pyrogram handler, leave from server side.

def stop_output(self)

Pause recording (output to callback).

Expand source code
def pause_recording(self):
    """Pause recording (output to callback)."""
    self.__is_recording_paused = True
def stop_playout(self)

Pause playout (playing from callback).

Expand source code
def pause_playout(self):
    """Pause playout (playing from callback)."""
    self.__is_playout_paused = True
def trigger_handlers(self, action: str, instance: GroupCallNative, *args, **kwargs)

Inherited from: GroupCallNative.trigger_handlers

Unregister the handler …