Commit dd49057
authored
Refactor voice receiving (#283)
* Refactor voice receiving
* Add DoNotParallelize attribute to idle timeout tests
* Fix a test
* Update BufferedVoiceReceiveHandlerTests to support async operations
* Improve tests and the buffered handler
* feat: Enhance voice handling with loss correction capabilities
- Updated VoiceReceiveEventArgs to include a canCorrectLoss flag for better loss management.
- Modified OpusDecoder methods to accept a decodeFec parameter for handling forward error correction.
- Adjusted OpusDecodeStream to utilize the new OpusDecoder methods.
- Enhanced VoiceClient to invoke events with loss correction information.
- Refactored VoiceReceiveData to use flags for packet status, including canCorrectLoss.
- Updated BufferedVoiceReceiveHandlerTests to validate new loss correction behavior.
- Added tests for canCorrectLoss scenarios to ensure proper handling of lost packets.
- Adjusted VoiceCommands to utilize updated decoding logic for handling voice frames.
* Correct (I believe) logic for handling lost packets in BufferedVoiceReceiveHandler
* Refactor
* Update buffered voice receive handler
* Improve voice receive handler
* Add FEC support
* Add FEC handling to BufferedVoiceReceiveHandlerTests
* Improve EvictLostFrames and rewrite and improve tests
* Refactor VoiceReceiveEventArgs and LostVoiceReceiveEventArgs for clarity and improved FEC handling; update VoiceCommands to streamline lost frame handling
* Refactor test voice commands
* Replace delegate with Action for VoiceReceive event in VoiceReceiveHandler
* Remove commented-out code and unnecessary console output in VoiceClient and BufferedVoiceReceiveHandler
* Remove unused using directive from BufferedVoiceReceiveHandler
* Optimize buffered voice receive handler state allocations
* Refactor window and buffer range checks in BufferedVoiceReceiveHandler for clarity and correctness
* Rename stop timer to timeout timer and improve datagram length validation in VoiceClient
* Refactor BufferedVoiceReceiveHandler to use VoiceReceiveData for improved clarity and data handling
* Remove BufferedVoiceReceiveHandler
* Cleanup
* Simplify voice receive event args
* Abandon VoiceReceiveHandler
* Fix voice guide snippet
* Remove allow unsafe blocks from NetCord.Test.csproj
* Make voice receiving exception safe against malformed payloads (hopefully)
* Skip decryption when there is no VoiceReceive event handler and remove a useless extension range check
* Fix voice receive logging and refactor
* Add a new line
* Add a comment to ReceiveVoice in guide snippet
* Make IP Discovery mandatory
* Optimize logging
* Improve a guides snippet comment and refactor VoiceClient slightly1 parent df3ec70 commit dd49057
11 files changed
Lines changed: 177 additions & 201 deletions
File tree
- Documentation/guides/basic-concepts
- Voice
- NetCord/Gateway/Voice
- EventArgs
- Streams
- Tests/NetCord.Test/ApplicationCommands
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | 132 | | |
134 | 133 | | |
135 | 134 | | |
| |||
141 | 140 | | |
142 | 141 | | |
143 | 142 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 143 | + | |
150 | 144 | | |
151 | | - | |
| 145 | + | |
152 | 146 | | |
153 | 147 | | |
154 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | | - | |
| 5 | + | |
| 6 | + | |
4 | 7 | | |
5 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
6 | 15 | | |
7 | 16 | | |
8 | 17 | | |
9 | 18 | | |
10 | | - | |
| 19 | + | |
11 | 20 | | |
12 | 21 | | |
13 | 22 | | |
14 | 23 | | |
15 | | - | |
| 24 | + | |
16 | 25 | | |
17 | 26 | | |
18 | | - | |
| 27 | + | |
19 | 28 | | |
20 | | - | |
| 29 | + | |
21 | 30 | | |
22 | 31 | | |
23 | 32 | | |
24 | 33 | | |
25 | | - | |
| 34 | + | |
26 | 35 | | |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | | - | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
54 | 56 | | |
55 | | - | |
| 57 | + | |
56 | 58 | | |
57 | | - | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| 68 | + | |
66 | 69 | | |
67 | | - | |
| 70 | + | |
68 | 71 | | |
69 | 72 | | |
70 | 73 | | |
71 | | - | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
| |||
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
| 87 | + | |
84 | 88 | | |
85 | | - | |
| 89 | + | |
86 | 90 | | |
87 | | - | |
| 91 | + | |
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
0 commit comments