Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

173
Views
¿Cómo pausar el otro mientras uno está jugando wavesurfer.js?

Decidimos usar wavesurferJS en nuestro proyecto React. Tengo varios archivos de audio. ¿Cómo hago para que los demás se detengan cuando toco uno de ellos? Probamos casi todas las soluciones a través de la web. Nada ayudó. Cualquier ayuda es apreciada.

 import React, { useRef, useEffect, useState } from "react"; import WaveSurfer from "wavesurfer.js"; const VoiceItem= ({url }) => { const waveformRef = useRef(); const [wavesurfer, setWavesurfer] = useState(null); useEffect(() => { if (waveformRef.current) { const wave = WaveSurfer.create({ container: waveformRef.current, }); wave.load(url); setWavesurfer(wave); } }, []); const togglePlayPause = () => { wavesurfer.playPause(); }; return ( <div> <button onClick={togglePlayPause}> </button> <div ref={waveformRef}></div> </div> ); }; export default VoiceItem;
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!