Skip to content

Fix PV compat crash with other improvements#988

Open
apehum wants to merge 6 commits into
tom5454:masterfrom
apehum:fix/pv-inject
Open

Fix PV compat crash with other improvements#988
apehum wants to merge 6 commits into
tom5454:masterfrom
apehum:fix/pv-inject

Conversation

@apehum

@apehum apehum commented Jun 9, 2026

Copy link
Copy Markdown

Fixes crash by swapping @Inject with @InjectPlasmoVoice:

[16:07:48] [Render thread/ERROR]: Unreported exception thrown!
java.lang.NullPointerException: Cannot invoke "su.plo.voice.api.client.PlasmoVoiceClient.getServerConnection()" because "this.voiceClient" is null
	at knot//com.tom.cpmpvc.CPMAddon.isMuted(CPMAddon.java:55)
	at knot//com.tom.cpmpvc.CPMPVC.isMuted(CPMPVC.java:43)
	...

Other changes not related to crash:

  • AudioCaptureProcessedEvent now passes audio only when actually speaking (aka using activations).
  • isMuted now respects client-side mutes.
    - AudioUtil (available in public API) is now used to calculate audio level and convert dB value to [0, 1] float range. Although audioLevelToDoubleRange actually maps from [-60, 0] -> [0, 1], so logic is not the same. But I found it more "accurate", because original [-127, 0] -> [0, 1] range means that -60 is 0.5, which is effectively silence.

@tom5454

tom5454 commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Models were made with the expectation of the old range, so changing the logic will break old models' animations.

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.

2 participants