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
How to change current time in audio playback?

I am trying to play an audio file with an offset of 10 seconds into the recording:

const audio = new Audio('audio.mp3');
audio.currentTime = 10
console.log('currentTime: ' + audio.currentTime)
console.log('duration: ' + audio.duration)
audio.play();

The output:

curretTime: 10
duration: NaN

Now this code will play the audio - but it will start from the beginning. How do I start the playback 10 seconds into the audio? Also, why is the duration printing as "NaN" ?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you are missing "n" from currentTime. should be audio.currentTime = 10;

about 4 years ago · Juan Pablo Isaza Report
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!