feat: enable looping for audio tracks

Ensure audio tracks loop continuously to improve user experience by maintaining audio ambiance without interruption. This change prevents abrupt stops when audio files reach their end, enhancing the seamlessness of sound playbacks.
This commit is contained in:
Kumi 2024-11-13 12:01:48 +01:00
parent efa5d905fe
commit b2ec8b62cb
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -2,6 +2,10 @@ const audioFiles = {
rain: new Audio('audio/rain.mp3'),
};
for (const audio in audioFiles) {
audioFiles[audio].loop = true;
}
function toggleSound() {
if (!playing) {
for (const audio in audioFiles) {