function onVolumeChanged() { 
    
    var slider = document.getElementById("volume");
    var value = slider.value;  
    wavesurfer.setVolume(value);
    
}      

function onImageSaveClick() {

    var oneCanvas = document.getElementsByTagName("canvas")[0];
    var inputElem = document.getElementById("fileName");
    
    var fileName = inputElem.value || "wellenwriter.png";
    fileName = fileName.indexOf(".png") === -1 ? fileName + ".png" : fileName;
    var url = oneCanvas.toDataURL();    
    
    // non-IE
    if (!window.ActiveXObject) {
        var save = document.createElement('a');
        save.target = '_blank';
        save.download = fileName || url;
        save.href = url;
        var ev = document.createEvent('MouseEvents');
        ev.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0,
            false, false, false, false, 0, null);
        save.dispatchEvent(ev);
        (window.URL || window.webkitURL).revokeObjectURL(url);
    }
    
     // IE
    else if (!!window.ActiveXObject && document.execCommand) {
        var _window = window.open(url, "_blank");
        _window.document.close();
        _window.document.execCommand('SaveAs', true, fileName || url)
        _window.close();
    }
    
    inputElem.value = "";
    return false;
    
}             
              