Playing Sound with React

Tiempo de lectura: < 1 minuto Today we are going to implement a function that will allow us to play sound using React. The first thing we need to do is to create this function that will allow us to load the sound: export function loadSound(source: string) { const sound = document.createElement(“audio”); sound.src = source; sound.setAttribute(“preload”, “auto”); sound.setAttribute(“controls”, “none”); sound.style.display = … Read more