Read the statement by Michael Teeuw here.
Sound loop not seamless. Request advice.
-
Makes sense but I’m not willing to make 3 copies of each sound file that will accompany the module, not to mention editing each and every one of them.
-
I understand that, It was a lot of work for me
Was thinking though, I think I only used 2 copies.
-
For those interested in helping me find a solution. I had intermittent success (sort of) with this function
myAudio = new Audio('modules/MMM-SoundMachine/sounds/rain.wav'); myAudio.addEventListener('ended', function() { this.currentTime = 0; this.play(); }, false); myAudio.play(); var audio = new Audio('modules/MMM-SoundMachine/sounds/rain.wav'); audio.addEventListener('canplaythrough', function() { this.currentTime = this.duration - 10; this.loop = true; this.play(); });
Half of the time the module would error
Failed to load resource: net::ERR_CACHE_OPERATION_NOT_SUPPORTED
This did not stop the module from loading but the sound file still has the gap when looping.The other half of the time the module would not error and the gap would be gone, a seamless loop. However, the sound would be distorted, almost as if the sound were playing twice, but offset. At least I’ve made some progress.
Still, I await assistance at your leisure, friends. :-)
-
Very interesting issue. Is it worked on RPI also?
-
@sean
Hi sean. No, I have not tried it on a Pi, yet. I only just started developing the module and came upon this issue. When/if I can solve this, the PI will get its chance.