4 Replies Latest reply on Aug 21, 2018 7:54 AM by Arthur Zitter

    MC3300 webbrowser warning sound

    Arthur Zitter

      Hi there,

      I am creating an webapp for the MC3300. I want a warning sound when the scanned code is incorrect.

       

      It's already working on my android mobile and tablet. But it is not working on the MC3300.

      How to tackle this problem?

       

      Thank you,

      Arthur

        • Re: MC3300 webbrowser warning sound
          Joydeep Chakraborty

          Please share your source code .

            • Re: MC3300 webbrowser warning sound
              Arthur Zitter

              Here is the source;

               

              <!DOCTYPE html>

              <html lang="en">

              <head>

                  <title>Soundtest MC3300</title>

                  <meta charset="ISO-8859-1" />

                  <meta name="viewport" content="width=device-width, initial-scale=1"/>

                  <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>

               

              </head>

              <body>

              <p>Beep after input (search) via ajax</p>

               

              <button type="button" id="search">Search</button>

              <button id="play" type="button">Play</button>

               

              <div id="warning">When there is a class "beep" play a sound</div>

               

              <script>

                  $(document).ready(function(){

                      $("#search").on("click", function () {

                          var audio = new Audio("https://www.soundjay.com/misc/bell-ringing-01.wav");

                          $.ajax({

                              type: "POST",

                              url: "sound_ajax.php",

                              success: function(resp){

                                  $("#warning").addClass(resp);

                                  $("#warning").html("Loaded ");

               

                                  // Does not work

                                  if ($("#warning").hasClass("beep") == true) {

                                      var audio = new Audio("https://www.soundjay.com/misc/bell-ringing-01.wav");

                                      audio.play();

                                      $("#warning").append("1");

                                  } else {

                                      $("#warning").append("1 failed");                    }

                              },

                              error: function(e) {

                                  console.log("error", e);

                              },

                              complete: function(){

                                  // werkt niet

                                  if ($("#warning").hasClass("beep") == true) {

                                      var audio = new Audio("https://www.soundjay.com/misc/bell-ringing-01.wav");

                                      audio.play();

                                      $("#warning").append("2");

                                  } else {

                                      $("#warning").append("2 failed");                    }

                              }

                          })

                      });

               

                      $("#play").on("click", function() {

                          var audio = new Audio("https://www.soundjay.com/misc/bell-ringing-01.wav");

                          audio.play();

                      });

                  });

              </script>

              </body>

              </html>

               

              and the call to the ajax source;

               

              <?php

              sleep(1);

              echo "beep";

              ?>

            • Re: MC3300 webbrowser warning sound
              Arthur Zitter

              I just send you the code by email.

              • Re: MC3300 webbrowser warning sound
                Arthur Zitter

                Solved

                 

                Run the app via EB and the sound works.