在html中刷新音频缓冲区

时间:2015-05-22 09:58:58

标签: javascript html audio

我有一个带有记录按钮的jsp页面,用于记录和保存波形文件,以及一个播放按钮。

我的问题是当我在html中使用音频标签播放wave文件时,最新录制的文件无法播放。而是播放页面加载后记录的第一个文件。

我的游戏脚本:

的JavaScript

function play() {
    var thissound="http://localhost:8084/ProjectName/"+'${cookie.JSESSIONID.value}'+".wav";

    document.getElementById('audio1');
    var audio=document.createElement("audio");
    audio.setAttribute("preload","none");
    audio.setAttribute("autoplay","true");
    audio.setAttribute("visibility","hidden");
    audio.setAttribute('src',thissound);

}

HTML

<input type="button" value="play" onclick="play();"></input>

0 个答案:

没有答案