MarshalX / tgcalls

Voice chats, private incoming and outgoing calls in Telegram for Developers
https://t.me/tgcallslib
GNU Lesser General Public License v3.0
514 stars 91 forks source link

Silent in group call #198

Closed Ivan-Firefly closed 1 year ago

Ivan-Firefly commented 1 year ago

Hi there!

I'm trying to stream my environment sound (catched by mic) and hear the other's members sound (get code from your example and modify a little - (https://github.com/MarshalX/tgcalls/blob/dev/examples/device_playout.py)). My partner could hear me, but there is silence in my headphones, while he is speaking. What am I doing wrong?

Code I use is bellow:

import os
import asyncio

import pytgcalls

import pyrogram

API_HASH = ''
API_ID = ''
CHAT_ID = ''
INPUT_DEVICE_NAME = 'Microphone'
OUTPUT_DEVICE_NAME = 'Headphones (High Definition Audio Device)'
CLIENT_TYPE = pytgcalls.GroupCallFactory.MTPROTO_CLIENT_TYPE.PYROGRAM

async def main(client):
    await client.start()
    while not client.is_connected:
        await asyncio.sleep(1)

    group_call = pytgcalls.GroupCallFactory(client, CLIENT_TYPE,enable_logs_to_console=True)\
        .get_device_group_call(INPUT_DEVICE_NAME, OUTPUT_DEVICE_NAME)

    await group_call.start(CHAT_ID)

    # to get available device names
    print(group_call.get_playout_devices())
    print(group_call.get_recording_devices())

    await pyrogram.idle()

if __name__ == '__main__':
    pyro_client = pyrogram.Client(
    "my_account",
    api_id=API_ID, api_hash=API_HASH)
    main_client = pyro_client
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main(main_client))
MarshalX commented 1 year ago

Receiving of sound was broken and not fixed yet. Only sending works

Ivan-Firefly commented 1 year ago

Thanks for the answer. Than will wait for new release and note in changelog