From 4692afcc3b7f29bf322228d932cfd6fe0909b073 Mon Sep 17 00:00:00 2001 From: wangjiyu Date: Thu, 10 Apr 2025 10:48:05 +0800 Subject: [PATCH] add recv python script --- test_recv.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test_recv.py b/test_recv.py index e69de29..0899097 100644 --- a/test_recv.py +++ b/test_recv.py @@ -0,0 +1,26 @@ +import rtc_plugins +import time +import numpy as np + +srcUserId = "srcUser1" +destUserId = "destUser1" + +srcDisplayName = "srcDisplayName1" +destDisplayName = "destDisplayName1" +srcRoomId = "srcRoom1" +destRoomId = "destRoomId1" +srcChannelIndex = 42 +destChannelIndex = 43 +def my_callback(npData, dataCount, sampleRate, numChannels, channelIndex): + print(f"dataCount:{dataCount}, sampleRate:{sampleRate}, numChannels:{numChannels}, channelIndex:{channelIndex}") +ret = rtc_plugins.init(destUserId, destDisplayName, destRoomId, my_callback) +if ret != 0: + print(f"init fail, ret:{ret}") + exit(1) +ret = rtc_plugins.initRecv(destRoomId, srcUserId, destChannelIndex) +if ret != 0: + print(f"initRecv fail, ret:{ret}") + exit(1) + +while True: + time.sleep(3)