CLOSES #1090, CLOSES #1093, CLOSES #1094, CLOSES #1095, CLOSES #1098, CLOSES #1102, CLOSES #1105, CLOSES #1106, CLOSES #1108, CLOSES #1109, CLOSES #1110, CLOSES #1111, CLOSES #1113, CLOSES #1114, CLOSES #1117, CLOSES #1118, CLOSES #1121, CLOSES #1122, CLOSES #1123, CLOSES #1124, CLOSES #1126, CLOSES #1127, CLOSES #1128, CLOSES #1131, CLOSES #1132, CLOSES #1134, CLOSES #1137, CLOSES #1141

This commit is contained in:
bryanthaboi
2026-08-11 21:19:36 -04:00
parent 01aab1d763
commit 0136429d3e
24 changed files with 694 additions and 167 deletions
+13 -2
View File
@@ -203,7 +203,8 @@ function ChipAudio.playMusic(data, header, allowLoops)
cmdCh:push({ cmd = "play", gen = gen, header = header,
allowLoops = allowLoops, audio = slimAudio(data),
channelVolumes = ChipSynth.getChannelVolumes(),
channelPitches = ChipSynth.getChannelPitches() })
channelPitches = ChipSynth.getChannelPitches(),
stereo = ChipSynth.getStereo() })
currentMusic = { source = source, gen = gen, threaded = true,
started = false, finished = false }
-- playback starts in update() once the first buffer arrives (~1 frame)
@@ -214,7 +215,8 @@ local function pushChannelMix()
if workerReady and cmdCh then
cmdCh:push({ cmd = "channelMix",
volumes = ChipSynth.getChannelVolumes(),
pitches = ChipSynth.getChannelPitches() })
pitches = ChipSynth.getChannelPitches(),
stereo = ChipSynth.getStereo() })
end
end
@@ -352,6 +354,15 @@ function ChipAudio.shutdown()
workerReady = false
end
function ChipAudio.setStereo(enabled)
ChipSynth.setStereo(enabled)
pushChannelMix()
end
function ChipAudio.getStereo()
return ChipSynth.getStereo()
end
-- Runtime mix for one hardware channel (1..4). Takes effect on the next
-- synthesized buffer (live music) and on any SFX/cry rendered after the call.
function ChipAudio.setChannelVolume(hw, scale)