Zrzur المطوّرون

الصوت

يعمل صوت زرزور على LiveKit. تصدر الواجهة التذاكر، ويمر الصوت نفسه عبر عميل LiveKit.

ما يعمل

القدرةالحالة
الحصول على تذكرة لقناة صوتية (POST /channels/{target}/join_call)مدعوم، وفُحص حيًا برمز بوت
الاتصال بـLiveKit بالتذكرة ونشر الصوتمدعوم. فُحص من طرف إلى طرف بـ@livekit/rtc-node: استقبل مشارك ثانٍ صوت البوت وقاسه
استقبال صوت المشاركين الآخرينممكن بعميل LiveKit، ويتطلب Listen. لا تغطيه اختباراتنا
نقل الأعضاء وكتمهم ومنعهم من السماع (PATCH /servers/{server_id}/members/{member_id})مدعوم مع Move Members وMute Members وDeafen Members
الفيديو ومشاركة الشاشة من بوتلم يُختبر، وتتبع التذاكر صلاحية Video
force_disconnect عند الانضمامليس للبوتات (IsBot)

الانضمام

اطلب تذكرة عبر HTTP مباشرة:

curl -X POST "https://api.zrzur.com/channels/CHANNEL_ID/join_call" \
  -H "x-bot-token: YOUR_BOT_TOKEN" \
  -H "content-type: application/json" \
  -d '{}'
# answer: { "token": "LIVEKIT_TOKEN", "url": "wss://voice.zrzur.com" }

ثم اتصل بعميل LiveKit. بالحزمة (غير منشورة بعد) و@livekit/rtc-node:

const ticket = await bot.voice.join(channelId); // { url, token, node }
const room = new Room(); // from @livekit/rtc-node
await room.connect(ticket.url, ticket.token, { autoSubscribe: false });

ثم أنشئ AudioSource بتردد 48 كيلوهرتز، وغلّفه في LocalAudioTrack، وانشره بـroom.localParticipant.publishTrack(...) وغذّه بإطارات من 10 ميلي ثانية. يرى الأعضاء الآخرون VoiceChannelJoin حين يدخل البوت الغرفة.

يحتاج البوت إلى Connect للانضمام وإلى Speak ليُسمع. ويسرد GET / عقد الصوت في features.livekit.nodes.

في درس الصوت أمر /join كامل.

المرجع

PUT /channels/{target}/end_ring/{target_user}

Stop Ring. Stops ringing a specific user in a dm call. You must be in the call to use this endpoint, returns NotConnected otherwise. Only valid in DM/Group channels, will return NoEffect in servers. Returns NotFound if the user is not in the dm/group channel

حد المعدل: channels, 15 / 10 s

POST /channels/{target}/join_call

Join Call. Asks the voice server for a token to join the call.

الصلاحيات: Channel:Connect, Channel:ManageChannel · حد المعدل: channels, 15 / 10 s

POST /channels/{target}/soundboard/{sound_id}

Play Sound. Play a sound of this server into the voice channel you are in. Needs Use Soundboard and Speak there, and not being server-muted; on a stage only speakers play sounds. Limited to a few sounds every ten seconds.

الصلاحيات: Channel:UseSoundboard, Channel:Speak · حد المعدل: channels, 15 / 10 s

DELETE /channels/{target}/stage

End Stage. Closes the stage: everyone leaves the call and the topic, speakers and raised hands are cleared. Needs Mute Members and Move Members.

الصلاحيات: Channel:MuteMembers, Channel:MoveMembers · حد المعدل: channels, 15 / 10 s

GET /channels/{target}/stage

Fetch Stage. Topic, speakers and raised hands of a stage channel.

حد المعدل: channels, 15 / 10 s

PATCH /channels/{target}/stage

Edit Stage. Set or clear the topic of a stage (needs Mute Members).

الصلاحيات: Channel:MuteMembers · حد المعدل: channels, 15 / 10 s

PUT /channels/{target}/stage/hand

Raise Hand. Ask to speak on a stage you are listening to (once every 20 seconds).

الصلاحيات: Channel:Connect · حد المعدل: channels, 15 / 10 s

DELETE /channels/{target}/stage/hands/{member}

Lower Hand. Lower your own raised hand, or (with Mute Members) someone else's.

الصلاحيات: Channel:MuteMembers · حد المعدل: channels, 15 / 10 s

DELETE /channels/{target}/stage/speakers/{member}

Move To Audience. Stop speaking yourself, or (with Mute Members and a higher rank) send a speaker back to the listeners. When the voice server can't be told, the speaker is taken out of the call rather than left able to talk.

الصلاحيات: Channel:MuteMembers · حد المعدل: channels, 15 / 10 s

PUT /channels/{target}/stage/speakers/{member}

Invite To Speak. Give someone in the stage the floor (needs Mute Members, and a higher rank than theirs). Their raised hand goes down.

الصلاحيات: Channel:MuteMembers · حد المعدل: channels, 15 / 10 s

PUT /channels/{target}/stream_preview

Send Stream Preview. Replace the preview of your screen share in this voice channel (a JPEG or WebP of at most 20 KB, base64). Only while you share your screen there; a new one is taken at most every 25 seconds (NoEffect before that).

حد المعدل: channels, 15 / 10 s

GET /channels/{target}/stream_preview/{member}

Fetch Stream Preview. The latest still of someone's screen share in a voice channel you can see.

الصلاحيات: Channel:ViewChannel, Channel:Listen · حد المعدل: channels, 15 / 10 s