Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#2916](https://github.com/Pycord-Development/pycord/pull/2916))
- Fixed a crash when processing message edit events while message cache was disabled.
([#2924](https://github.com/Pycord-Development/pycord/pull/2924))
- Fixed OPUS Decode Error when recording audio.
([#2925](https://github.com/Pycord-Development/pycord/pull/2925))

### Removed

Expand Down
9 changes: 5 additions & 4 deletions discord/voice_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,10 @@ def _decrypt_aead_xchacha20_poly1305_rtpsize(self, header, data):
nonce[:4] = data[-4:]
data = data[:-4]

return self.strip_header_ext(
box.decrypt(bytes(data), bytes(header), bytes(nonce))
)
r = box.decrypt(bytes(data), bytes(header), bytes(nonce))
# Discord adds 8 bytes of data before the opus data.
# This can be removed, and at this time, discarded as it is unclear what they are for.
return r[8:]

@staticmethod
def strip_header_ext(data):
Expand Down Expand Up @@ -774,7 +775,7 @@ def unpack_audio(self, data):
data: :class:`bytes`
Bytes received by Discord via the UDP connection used for sending and receiving voice data.
"""
if data[1] != 0x78:
if data[1] & 0x78 != 0x78:
# We Should Ignore Any Payload Types We Do Not Understand
# Ref RFC 3550 5.1 payload type
# At Some Point We Noted That We Should Ignore Only Types 200 - 204 inclusive.
Expand Down
Loading