Flic Home

    Community

    • Login
    • Search
    • Popular
    • Users

    Hub SDK IR Module not playing

    Flic Hub SDK
    2
    4
    760
    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.
    • oskaremilsson
      oskaremilsson last edited by

      I'm trying to get a custom module to play IR. Starting off with a few general headaches from trying;

      1. It's pretty weird that you can't access the already stored IR-signals.
      2. Even if recording specifically for my module theres really no good way of storing it for when the module restarts. Storing Uint32Array as a string is a nightmare.
      3. I can't get it to play even a Uint32Array thats JUST got recorded. Even though I can see that it got recorded OK.
      ir.record();
      
      ir.on("recordComplete", function(signal) {
      	console.log(signal[0]);
      	setTimeout(function() {
      		console.log(signal[0])
      		ir.play(signal, function(err) {
      			console.log(err); //never called
      			console.log("played!"); //never called
      		});
      	}, 1000);
      });
      

      Console never writes out any err or played!. No IR is sent from the sender. However, i can tell that signal[0] is the same so it's actually trying to run play for the correct array.

      There is no new record ongoing, I've even tried to run the stopRecording before .play() without any difference.

      Any idea of why my .play() won't work?

      I've also noticed that the console prints Connected: 0 when recoding starts and when .play()is called. Related?

      oskaremilsson 1 Reply Last reply Reply Quote 0
      • oskaremilsson
        oskaremilsson @Emil last edited by

        @Emil
        Did the record part work all the time, while the playing part failed all the time? Yes.

        Are you using the 1st hub generation or the 2nd (Hub LR)? 2nd.

        But my bet is that I might have sent in some bad Array while testing that made the IR-queue never emptying/play never ending? Maybe.

        1 Reply Last reply Reply Quote 0
        • Emil
          Emil FlicTeam last edited by Emil

          Did the record part work all the time, while the playing part failed all the time?

          Are you using the 1st hub generation or the 2nd (Hub LR)?

          oskaremilsson 1 Reply Last reply Reply Quote 0
          • oskaremilsson
            oskaremilsson @oskaremilsson last edited by

            @oskaremilsson It really seems like I've in my very many attempts to get this to work queued up the IR-queue too much, when it didn't work from the app either I restarted the hub. And now this snippet works.

            So now the question would be, is there any way of clearing the queue except restarting the hub?

            1 Reply Last reply Reply Quote 0
            • First post
              Last post