voice_client.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:curious 作者: SunDwarf 项目源码 文件源码
def get_packet_header(self) -> bytes:
        """
        Gets the voice packet header.

        :return: The bytes of the header.
        """
        header = bytearray(12)

        # constant values, provided by the docs
        header[0:2] = b"\x80\x78"

        # dynamic values
        # offset 2 -> sequence
        struct.pack_into(">H", header, 2, self.sequence)
        # offset 4 -> timestamp
        struct.pack_into(">I", header, 4, self.timestamp)
        # offset 8 -> ssrc
        struct.pack_into(">I", header, 8, self.vs_ws.ssrc)

        return header
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号