MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Sound loop not seamless. Request advice.

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    7 Posts 3 Posters 2.0k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Mykle1M Offline
      Mykle1 Project Sponsor Module Developer @justjim1220
      last edited by

      @justjim1220

      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.

      Create a working config
      How to add modules

      justjim1220J 1 Reply Last reply Reply Quote 0
      • justjim1220J Offline
        justjim1220 Module Developer @Mykle1
        last edited by

        @mykle1

        I understand that, It was a lot of work for me

        Was thinking though, I think I only used 2 copies.

        "Life's Too Short To Dance With Ugly People"
        Jim Hallock - 1995

        1 Reply Last reply Reply Quote 0
        • Mykle1M Offline
          Mykle1 Project Sponsor Module Developer
          last edited by

          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. :-)

          Create a working config
          How to add modules

          1 Reply Last reply Reply Quote 0
          • ? Offline
            A Former User
            last edited by

            Very interesting issue. Is it worked on RPI also?

            Mykle1M 1 Reply Last reply Reply Quote 0
            • Mykle1M Offline
              Mykle1 Project Sponsor Module Developer @Guest
              last edited by

              @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.

              Create a working config
              How to add modules

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy