Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Add the client id (0-31) to the lowpart of "steamid" in the voice packet, so the voice packets can be differentiated from each other.
This is likely how steam handles decoding separate audio streams with their own decoder states, and sending everything with same id breaks this.
Also set the samplerate packet to send 8000 to match reality (even though neither opus nor silk use it so it shouldn't really affect anything)
Open Questions and Pre-Merge TODOs
The above part is mere speculation how the audio stream separation is handled is merely an educated guess, as the steam API func DecompressVoice does not have any knowledge of internal game state. The
Voice_AddIncomingData
function that calls it knows which of the five available voice channels the current audio stream is on, but this isn't passed into steam api.So unless the steam client accesses the game's memory, the only way the api func can differentiate voice packets is by using the information in the packet itself, i.e. the "steamid". This is why its an "educated" guess, but it still is a guess and not confirmed that it is actually how it works.
That all being said, it doesn't exactly hurt either to send the packets with different ids so even if the decoders are not separated like they should and the steamid isnt used.