Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

sound stopped working???????

ok so the sounds and music in my game was working until recently,its now stopped working.i have not changed anything. :( :( :(
  using sugercane.

Comments

  • Can you give some more information?  Such as which macro you're using?  Can you cut and paste the code for the macro as well as how it's used in the passage?
  • ok i will do that


    EDIT:
    Heres the macro,<<loopsound "beach.mp3" >>

    i also use the code from glorious train wrecks that allows it to play:

    (function () {
      "use strict";
      version.extensions['soundMacros'] = {
        major: 1,
        minor: 1,
        revision: 2
      };
      var p = macros['playsound'] = {
        soundtracks: {},
        handler: function (a, b, c, d) {
          var loop = function (m) {
              if (m.loop == undefined) {
                m.loopfn = function () {
                  this.play();
                };
                m.addEventListener('ended', m.loopfn, 0);
              } else m.loop = true;
              m.play();
              };
          var s = eval(d.fullArgs());
          if (s) {
            s = s.toString();
            var m = this.soundtracks[s.slice(0, s.lastIndexOf("."))];
            if (m) {
              if (b == "playsound") {
                m.play();
              } else if (b == "loopsound") {
                loop(m);
              } else if (b == "pausesound") {
                m.pause();
              } else if (b == "unloopsound") {
                if (m.loop != undefined) {
                  m.loop = false;
                } else if (m.loopfn) {
                  m.removeEventListener('ended', m.loopfn);
                  delete m.loopfn;
                }
              } else if (b == "stopsound") {
                m.pause();
                m.currentTime = 0;
              } else if (b == "fadeoutsound" || b == "fadeinsound") {
                if (m.interval) clearInterval(m.interval);
                if (b == "fadeinsound") {
                  if (m.currentTime>0) return;
                  m.volume = 0;
                  loop(m);
                } else {
                  if (!m.currentTime) return;
                  m.play();
                }
                var v = m.volume;
                m.interval = setInterval(function () {
                  v = Math.min(1, Math.max(0, v + 0.005 * (b == "fadeinsound" ? 1 : -1)));
                  m.volume = Math.easeInOut(v);
                  if (v == 0 || v == 1) clearInterval(m.interval);
                  if (v == 0) {
                    m.pause();
                    m.currentTime = 0;
                    m.volume = 1;
                  }
                }, 10);
              }
            }
          }
        }
      }
      macros['fadeinsound'] = p;
      macros['fadeoutsound'] = p;
      macros['unloopsound'] = p;
      macros['loopsound'] = p;
      macros['pausesound'] = p;
      macros['stopsound'] = p;
      macros['stopallsound'] = {
        handler: function () {
          var s = macros.playsound.soundtracks;
          for (var j in s) {
    if (s.hasOwnProperty(j)) {
              s[j].pause();
              if (s[j].currentTime) {
        s[j].currentTime = 0;
      }
    }
          }
        }
      }
      var div = document.getElementById("storeArea").firstChild;
      var fe = ["ogg", "mp3", "wav", "webm"];
      while (div) {
        var b = String.fromCharCode(92);
        var q = '"';
        var re = "['" + q + "]([^" + q + "']*?)" + b + ".(ogg|mp3|wav|webm)['" + q + "]";
        k(new RegExp(re, "gi"));
        div = div.nextSibling;
      }

      function k(c, e) {
        do {
          var d = c.exec(div.innerHTML);
          if (d) {
            var a = new Audio();
            if (a.canPlayType) {
              for (var i = -1; i < fe.length; i += 1) {
                if (i >= 0) d[2] = fe[i];
                if (a.canPlayType("audio/" + d[2])) break;
              }
              if (i < fe.length) {
                a.setAttribute("src", d[1] + "." + d[2]);
                a.interval = null;
                macros.playsound.soundtracks[d[1]] = a;
              } else console.log("Browser can't play '" + d[1] + "'");
            }
          }
        } while (d);
      }
    }());
  • So nothing looked wrong.  Then I opened an old game that I have that has sound, and the sound isn't working there either.  It was made in 1.4. 
  • Something interesting: this game has that same sound macro, and it is clearly working: http://silverstringmedia.com/before-the-end-of-the-world/
  • This is strange,how can i get it working again.i really dont know what to do. :( :( :( :(
  • @ss slothman

    The javascript you posted has errors in it, if it is what you are using then you need to replace with the 1.1.2 version from Leon's site. The link for the newer version is near the top of the page, it is named "TwineMacros-SoundMacros-1.1.2.txt"

    Try the 1.1.2 version and let us know if it fixes your problem.
  • Thankyou so much guys :D :D :D :D :D its working now :)
Sign In or Register to comment.