if (value) {
audio.play();
helper.add(audio);
} else {
helper._clearAudio(audio)
audio.pause()
}
I try to do this,but after my audio is over,there is a little part of the audio playing.This lead to next Animation and audio are not synchronized
try this code.
I asked this before. (It’s hidden post now…)
in my cases, it worked strangely.
let helper, clock; //mmd helper things...
let isStop = false;
//rendering function example.
const animate = () => {
requestAnimationFrame(animate);
if (!isStop) {
helper.update(clock.getDelta());
//placehere your rendering code.
}
};
//pause;
isStop = true;
helper.audio.pause();
clock.running = false;
//resume
isStop = false;