feat: improve RenPy conversion and support MIST runtime
This commit is contained in:
1 parent
f7f7f5b1b3
commit
f9eb5c1212
44 files changed
+2822
-174
No files matched your search
@@ -33,6 +33,18 @@ function tick(ms) {
|
||||
const volumes = () => ({ music: 0.7, sound: 0.8, voice: 1 });
|
||||
const system = (registered = {}) => new AudioSystem(volumes(), (file) => file, registered);
|
||||
|
||||
test("custom mixers control only their channels and survive changes to shared volumes", () => {
|
||||
const audio = system({ ambient: { mixer: "ambiant", loop: true }, ambient2: { mixer: "ambiant", loop: true } });
|
||||
audio.play("ambient", ["one"], {});
|
||||
audio.play("sound", ["effect"], {});
|
||||
audio.setMixer("ambiant", 0.3);
|
||||
assert.deepEqual(elements.map((el) => el.volume), [0.3, 0.8]);
|
||||
audio.setVolumes({ music: 0, sound: 0.2, voice: 1 });
|
||||
audio.play("ambient2", ["two"], {});
|
||||
assert.deepEqual(elements.map((el) => el.volume), [0.3, 0.2, 0.3]);
|
||||
assert.equal(audio.mixerVolume("ambiant"), 0.3);
|
||||
});
|
||||
|
||||
test("volume changes apply immediately to each mixer and future tracks", () => {
|
||||
const audio = system({ ambience: { mixer: "sfx", loop: true }, score: { mixer: "music", loop: true } });
|
||||
for (const ch of ["music", "sound", "voice", "ambience", "score"]) audio.play(ch, [ch], {});
|
||||
|
||||
Reference in new issue
Block a user