JavaScript
2
Вклад в тег
function s(e, t) {
t = Math.round(t), e.length != t && (e = a.fastResample(e, t));
for (var n = "", i = 0, r = 0; r < e.length; r++)
i = Math.floor(10 * e[r] * .95), 0 == i && (i = .5), n += "M" + (3 * r + 1) + "," + (10 - i) + "v" + 2 * i + "Z";
return '<svg class="audio-msg-track--wave" width="' + 3 * e.length + 'px"><path d="' + n + '"></path></svg>'
}
function a.fastResample(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "peak";
return new l({
srcSampleRate: e.length,
dstSampleRate: t,
normalizeAlgorithm: n,
truncateTo: 0
}