• js播放wav文件


    使用js,每隔1s播放对应的wav文件

    <script language="javascript">        

    var arr = new Array();        

    var c = 0;        

    window.onload = function () {            

       var value1 = '<%=tel_2 %>';             

       var value2 = '<%=je %>'            

       StrToArray(value1);            

       StrToArray(value2);

    }        

    var StrToArray = function (str) {            

        for (var i = 0; i < str.length; i++) {                

             arr[arr.length] = str.charAt(i);            

         }        

    }        

    var id = window.setInterval(function () {            

          if (c > arr.length) {                 

                      window.clearInterval(id); //清除      

                     return;      

          }            

          embed(arr[c++]);        

    }, 1000);        

    var embed = function (num) {            

               if (num == "" || typeof num == "undefined") return;            

               document.getElementById("embed").innerHTML = "<embed name=\"player\" TYPE=\"application/x-mplayer2\" src=\"../wav/" + num + ".wav\" loop=\"false\" autostart=\"true\" hidden=\"true\"></embed>";        

    }    

    </script>

  • 相关阅读:
    WINFORM 設計時 未能加载文件或程序集問題解決
    Remove row from generic datatable in C#(The given DataRow is not in the current DataRowCollection)
    questa.sim in the linux
    the io_printf
    how to search new file in linux
    the rld control core
    window's chkdsk
    tq
    the init state machine
    brazen out
  • 原文地址:https://www.cnblogs.com/KimhillZhang/p/3032036.html
Copyright © 2020-2023  润新知