Skip to content

Additional Voice Chat Features#180

Open
witabop wants to merge 2 commits intonot-nullptr:mainfrom
witabop:witabop-dev-call
Open

Additional Voice Chat Features#180
witabop wants to merge 2 commits intonot-nullptr:mainfrom
witabop:witabop-dev-call

Conversation

@witabop
Copy link

@witabop witabop commented Feb 21, 2026

Here's the run down of the general changes I did to make the voice chat experience feel a bit better!

Sound playback fix
Okay so this one wasn't actually related to voice chat but I needed to fix this for the join/leave call sounds below. Essentially all sound playback was bugged and not playing.

  • Sounds were embedded as Resource and played via relative URIs when the WPF MediaPlayer needs real file paths.
  • All .wav files under Resources/Sounds are now Content with CopyToOutputDirectory="PreserveNewest", and the new SoundHelper builds URIs from AppDomain.CurrentDomain.BaseDirectory so playback uses the copied files.
  • Nudge/type/online and join/leave call sounds now use the same persistent chatSoundPlayer (or a static player in SoundHelper) so the player isn’t collected before MediaOpened fires.

Join/leave call sounds
It's pretty much what it says it is. Just adds a join and leave sound.

  • OnVoiceStateUpdated compares Before.Channel?.Id and After.Channel?.Id to detect join/leave.

Speaking glow
does that green circle thing that happens when you talk on discord, though I changed it to fit the theme

  • VoiceSocket maps SSRC to user (opcode 5) and computes RMS on incoming PCM; above a certain threshold sets “speaking” and a timer that clears it after ~300 ms.
  • UserViewModel.IsSpeaking is updated from VoiceManager events; connected-user items use a DataTrigger on IsSpeaking to show a faint green gradient + DropShadowEffect.
image

Voice user context menu
Similar to how you can open a context menu when you right click someone in call on discord, you can do it here now.

  • Profile: placeholder, my other MR implements the user profile popup so I couldn't attach it here yet.
  • Mute: client = stop sending, others = stop playing their audio (per-SSRC mute in NAudioPlayer).
  • Deafen: stop adding received audio to the mixer (SelfDeafened skips ProcessPacket).
  • Volume Adjustment: I couldn't figure out how to do a slider so I did a submenu from 0%–200% (25% steps). Client = scale PCM before encode (ClientTransmitVolume); others = per-SSRC VolumeSampleProvider in the mixer.
image

@witabop
Copy link
Author

witabop commented Feb 21, 2026

holy fumble I forgot to git add the sound helper AND audio files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant