Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

166
Vistas
How to make 2 audio files playable as 1 in React?

I am trying to make a website for a class where users can upload music (think soundcloud) and also 'add-on' to music that's been uploaded. This 'add-on' feature will work like TikTok's duet feature, where 2 audio files will play and pause at the same time with a single click of a button. The problem is, I am not sure how to implement it (I'm new to React and web development in general). Is there a library that does this, or is there any tips that can help me get started? Any feedback is appreciated!

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Maybe you can try this solution

https://stackoverflow.com/a/30493651/17177726

You can create a function that takes the audio's ID as a parameter and use that function on a button

about 4 years ago · Juan Pablo Isaza Denunciar

0

You can try the use-sound hook. It makes handling multiple sounds simultaneously a breeze.

You can either create two instances of the hook like this:

import useSound from 'use-sound';
import sound1 from '../audio/sound1.mp3';
import sound2 from '../audio/sound2.mp3';

const [sound1] = useSound(sound1);
const [sound2] = useSound(sound2);

Or you can use a sprite to layer them together in the same instance.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda