import alertFile from "@/assets/audios/alert.ogg";

export const playAlert = () => {
	let audioBox = document.createElement("AUDIO")
	audioBox.setAttribute("control", "")
	audioBox.setAttribute("autoplay", "")
	audioBox.innerHTML = "<source src=\"" + alertFile + "\" type=\"audio/ogg\"/>";
	document.body.appendChild(audioBox);
	audioBox.play().then(function () {
		setTimeout(function () {
			document.body.removeChild(audioBox);
		}, 2000);
	}).catch(function (e) {
		console.log(e.message);
	})
}