【问题标题】:Gap less playback through the soundmanager通过声音管理器减少播放间隙
【发布时间】:2014-01-09 14:13:42
【问题描述】:

我在我的项目中使用 soundmanager2。它有循环,所以声音文件与循环重复。但不幸的是,循环迭代之间存在间隙,这个循环间隙在 Chrome 浏览器中很小,但是当我浏览我的项目时,间隙更大Safari 或 ipad,,,, 简而言之,我的目标是实现它听到的持续声音,就像一首长歌一样.. 任何帮助都是可观的

<script type="text/javascript" src="script/soundmanager2.js"></script>
    <script type="text/javascript">
        var loops = 3 ;
        var looped = 0;


        soundManager.flashVersion = 9;
        soundManager.url = 'swf/';
        soundManager.onready(function () {

            soundManager.createSound({
                id: "sound1",
                url: "audiofiles/sound1.wav",
                stream: true,
               autoPlay: true,
                multiShot: true,
                onfinish: function () {
                    if (looped < loops) {
                        soundManager.play('sound1');
                        looped++;
                    } else {
                        looped = 0;
                    }
                }
            });
            soundManager.play('sound1', { loops: 3 });
        });

    </script>

【问题讨论】:

    标签: jquery soundmanager2


    【解决方案1】:

    我认为你必须使用 Web Api 令牌

    See Here

    【讨论】:

      【解决方案2】:

      在这里查看我的纯 HTML5 解决方案:gapless looping audio html5

      如那里所述,通过数据 URI 获取文件并使用 2 个实例进行循环。

      SoundManager2 示例代码:

      function LoopBackgroundMusic(){
          back_music.play();
          setTimeout(LoopBackgroundMusic, 5333); //5333 is the length of the audio clip in milliseconds
      }
      

      【讨论】:

      • 我一定会尝试的,thnx 伙计,你是如何从记录中得到我的老问题的
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-12-08
      • 2017-07-18
      • 1970-01-01
      • 2012-08-18
      • 2014-06-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多