audio: route JavaCV samples through SourceDataLine with live gain
Some checks failed
build / build (push) Has been cancelled

setVolume/Mute previously stored gain without affecting audible output: the
backend only called grabImage() and never opened an audio sink. Switch to
grab() (interleaved video+audio frames), force AV_SAMPLE_FMT_S16 on the
grabber so samples are always interleaved signed 16-bit PCM, open a matching
JavaSound SourceDataLine and write scaled samples per-frame. gain is read
on every block so /videoMute, GUI Mute and the per-tick distance attenuation
now take effect immediately. SourceDataLine.write blocking provides natural
A/V pacing, so the legacy 15ms sleep is dropped when an audio line is open;
sleep is retained as a 60fps cap when there is no audio device.

bump version to 0.3.1.
This commit is contained in:
tkrmagid
2026-05-15 19:45:42 +09:00
parent 52fbcd1861
commit 429244d820
2 changed files with 103 additions and 13 deletions

View File

@@ -5,7 +5,7 @@ org.gradle.configuration-cache=false
# Mod
mod_id=video_player
mod_version=0.3.0
mod_version=0.3.1
maven_group=com.ejclaw.videoplayer
archives_base_name=video_player